Setting the value of date inputs on iPad

后端 未结 2 846
北恋
北恋 2021-01-04 13:51

WEB APP not native, no Objective-C

This is so simple it hurts.

  

Done to use the iPa

相关标签:
2条回答
  • 2021-01-04 14:09

    Try this for Safari on iOS 5

     $('input[type="date"]').val('yyyy-MM-dd');
    

    You could do the conversion from the type of Date you are using to yyyy-MM-DD in JavaScript using the Date() function.

    0 讨论(0)
  • 2021-01-04 14:09

    for iOS6 the ISO format "YYYY-MM-DDTHH:mm:ss.sssZ" is required:

    var now = new Date().toISOString();
    $("input[type=datetime]").val(now);
    
    0 讨论(0)
提交回复
热议问题