0

I have an input type html element where the date format is mm/dd/yyyy.

enter image description hereI coded the whole app, in the server,executing through ionic serve. Now when i installed the app on mobile, the date format of the input type is set as yyyy/mm/dd.Can anyone tell me what to do in this situation?Sorry couldn't provide any plunker.

The code is:

<div class="row"> 
    <div class="col-50 padd_5">
        <label class="item item-input">Date:</label>
        <input type="date" placeholder="Enter Date" ng-model="createEventForm.date" name="eventDate" required>
         <br />
         <div ng-show="eventFormObject.$submitted || eventFormObject.eventDate.$touched">
             <div ng-show="eventFormObject.eventDate.$invalid">Event date is invalid.</div>
         </div>
    </div>
</div>

Note:This question is not a dublicate of Is there any way to change input type="date" format? as no data for mobile input type date view is given,only html5

Community
  • 1
  • 1
Debojyoti
  • 169
  • 1
  • 14
  • 2
    Where is the code for it.? – M. Junaid Salaat May 24 '16 at 12:05
  • Possible duplicate of [Is there any way to change input type="date" format?](http://stackoverflow.com/questions/7372038/is-there-any-way-to-change-input-type-date-format) – Rhumborl May 24 '16 at 12:15
  • This post will help you http://stackoverflow.com/questions/7372038/is-there-any-way-to-change-input-type-date-format – Wasiq Muhammad May 24 '16 at 12:17
  • @Rhumborl the question is not dublicate as no data for mobile input type date view is given,only html5 – Debojyoti May 24 '16 at 12:19
  • that's irrelevant, it's still how to display an `` in a browser, whether that's on mobile, desktop or otherwise - it's the same ("html5") element – Rhumborl May 24 '16 at 12:20
  • @Rhumborl so you are saying that there is no way to change the default html date format?i then can do the changes.But the problem will then arise that i cannot test with ionic serve as well as in the mobile as both of them have different input type date default format? – Debojyoti May 24 '16 at 12:35
  • @Rhumborl server->mm/dd/yyyy ; mobile->yyyy/mm/dd. these are the default formats.If there is nothing i can do but to test for only one form factor i.e. mobile then i will close this question as answered.Give me your opinion – Debojyoti May 24 '16 at 12:36

1 Answers1

0

After checking @Rhumborl's comments , i came to the conclusion that date format for html5 cannot be changed.It paves way for a rather awkward situation that the default date format for server is mm/dd/yyyy and for mobile it is yyyy/mm/dd.Anyways thanks for your time who commented.

Debojyoti
  • 169
  • 1
  • 14