This is a migrated thread and some comments may be shown as answers.

Set a default value in a datetime input

2 Answers 63 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Audrey
Top achievements
Rank 1
Audrey asked on 28 Mar 2013, 03:30 PM
Hello,
I'm trying to set a default value in a datetime input, it works fine on web navigator as Firefox or Google Chrome, but once on the app on the device, the input stays empty (on both android and iOS)

Bellow my code :

  <input type="datetime" id="nDate" name="Date" style="color:#757575;" >

 function DefaultValues() {
             var d = new Date();
             var jour = d.getDate();
             var mois = d.getMonth() + 1;
             var annee = d.getFullYear();
             var heure = d.getHours();
             var min = d.getMinutes();
             if (heure < 10) {
                 heure = "0" + heure;
             }
             if (min < 10) {
                 min = "0" + min;
             }
             if (jour < 10) {
                 jour = "0" + jour;
             }
             if (mois < 10) {
                 mois = "0" + mois;
             }
             var nDate = annee + "-" + mois + "-" + jour + "T" + heure + ":" + min + ":00";
             $("#nDate").val(nDate);
         }

2 Answers, 1 is accepted

Sort by
0
Audrey
Top achievements
Rank 1
answered on 29 Mar 2013, 02:37 PM
No idea ?
0
Steve
Telerik team
answered on 01 Apr 2013, 02:33 PM
Hi Audrey,

According to this compatibility list, input type=datetime is not supported on Android (see also) and should work on Safari > v.5.0.

Regards,
Steve
the Telerik team

Share feedback and vote for features on our Feedback Portal.
Want some Kendo UI online training - head over to Kendo UI Dojo.
Tags
General Discussion
Asked by
Audrey
Top achievements
Rank 1
Answers by
Audrey
Top achievements
Rank 1
Steve
Telerik team
Share this question
or