javascript - jQuery datepicker keeps returning mm/dd/yyyy -
i have jquery datepicker defined in code this: $fromdate = strtotime($vacancy[0]->vacancy_visibility_start_date); $fromdate = date('d/m/y',$fromdate); $calendarfromarray = array( 'name' => 'datepicker', 'id' => 'datepicker', 'value' => $fromdate ); my js looks this: $( "#datepickerfrom" ).datepicker({ dateformat: 'dd-mm-yy' }); $( "#datepickerto" ).datepicker({ dateformat: 'dd-mm-yy' }); even though datepicker appears , works date remains in mm/dd/yyyy format.