JuanTomas Posted April 14, 2016 Share Posted April 14, 2016 (edited) Found it! Here is the original HTML line with no dateFormat: <script>$(document).ready(function(){$('.customDatePicker').datepicker();});</script> Here's the same line with a dateFormat specified (note that "yy" means "four-digit year", not "two-digit year" in this context): <script>$(document).ready(function(){$('.customDatePicker').datepicker({dateFormat: "yy-mm-dd"});});</script> Original post follows: --------------------------------------------------------------------------------------------------------------- I have this in php: $this->addJqueryUi('ui.datepicker'); And this in HTML: Delivery Date: <input type="text" name="delivery_date" label="Delivery Date" class="customDatePicker" id="delivery_date" value="'.date('Y-m-d').'"> <script>$(document).ready(function(){$(\'.customDatePicker\').datepicker();});</script> And it works, EXCEPT the datepicker fills out the form field with the date in dd/mm/yyyy format. This breaks my postProcess, which expects to get the date in yyyy-mm-dd If I look in js/date.js I find: //Date.format = 'dd/mm/yyyy'; //Date.format = 'mm/dd/yyyy'; Date.format = 'yyyy-mm-dd'; //Date.format = 'dd mmm yy'; So that's not the problem. In my Dashboard, the date range controls display in yyyy-mm-dd In Orders, the date range pickers display in dd/mm/yyyy I could work around it in postProcess, of course. But I'd prefer employees to see the date in yyyy-mm-dd. How to control this date format? Thanks in advance! Edited April 14, 2016 by JuanTomas (see edit history) Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now