Drupal 8 and Moment JS - To fix client side date format issue on browser wise

by Julia   Last Updated May 15, 2019 11:07 AM

Different Browser and OS shows different date format on client side.

In Chrome: dd/mm/yyyy In Safari: yyyy-mm-dd

<input data-drupal-selector="edit-field-date-end-value-date" title="Date (e.g. 2019-05-15)" type="date" min="1969-05-15" max="2069-05-15" data-drupal-date-format="Y-m-d" id="edit-field-date-end-value-date" name="field_date[end_value][date]" value="2019-05-11" size="12" class="form-date hasDatepicker">

Issue with Input type Date, because it is showing as per browsers HTML5 or HTML4.

How to solve this issue? So while load or if select from datepicker then it also solves?

May be need to use Moment JS?

http://jsfiddle.net/g7mvaosL/

Tags : 8 location


Related Questions


Updated June 09, 2015 12:03 PM

Updated April 22, 2017 14:07 PM

Updated June 30, 2015 21:03 PM

Updated August 13, 2015 18:03 PM

Updated July 01, 2017 06:07 AM