1

Data from database is correct and date format modification also work correctly, while printing it in datepicker input field ,it gives me invalid date error for future date but works fine for present and past date

Here is datepicker textbox

<input type="text" name="meeting_date" value="<?php print_r(date('d-m-Y',strtotime($edit[0]['meeting_date']))); ?>" class="form-control has-feedback-left" id="single_cal4" aria-describedby="inputSuccess2Status3">

Thanks in advance.

Pradeep
  • 9,667
  • 13
  • 27
  • 34
Deepak
  • 614
  • 1
  • 7
  • 20

2 Answers2

1

Hope this will help you :

Make sure date format for datepicker is correct try with m-d-Y or Y-m-d

and use echo instead of print_r or use shorthand php syntax like this :

<input type="text" 
       value="<?=date('m-d-Y',strtotime($edit[0]['meeting_date'])); ?>" 
       name="meeting_date"  
       class="form-control has-feedback-left" 
       id="single_cal4" aria-describedby="inputSuccess2Status3">
Pradeep
  • 9,667
  • 13
  • 27
  • 34
0

Please always share your error code. Anyways

Solution: Use different date format. Here is a solution on StackOverflow. I hope it helps.

Solutions 1

Solution 2

Pini Cheyni
  • 5,073
  • 2
  • 40
  • 58
Peter
  • 777
  • 2
  • 13
  • 34