KentBrockman Posted April 15, 2014 Posted April 15, 2014 Hey, is it possible to set the first day of the week to monday in the datepicker? Thank you for your support!
adrian Posted April 16, 2014 Posted April 16, 2014 I don't think there is a proper way to do this in PW (but I might be wrong). I found the setting in two places: https://github.com/ryancramerdesign/ProcessWire/blob/dev/wire/modules/Jquery/JqueryUI/JqueryUI.js Look for firstDay:0 and change it to firstDay:1 Obviously this is a core file and you don't want to modify this. The other place it is, is in the jqueryUI language files: https://github.com/ryancramerdesign/ProcessWire/tree/dev/wire/modules/Jquery/JqueryUI/i18n Trouble is there doesn't seem to be one for US English, which is why it is defaulting to 0 (assuming that is your locale). Even so, these are still core files and shouldn't modified. The only other solution I am seeing around the place is a jQuery hack: http://stackoverflow.com/questions/1313317/set-start-day-of-the-week-in-jquery-ui-datepicker Not a great answer I'm afraid!
apeisa Posted May 12, 2014 Posted May 12, 2014 It's possible to localize with language support. Just translate the file InputfieldDatetime.module (if I remember right) and there is option for translation (also affects the first day of the week). 2
joey102030 Posted May 12, 2014 Posted May 12, 2014 How about other custom options like 'minDate' Update... I've got the following JQuery solution working: <script type="text/javascript"> $('.InputfieldDatetimeDatepicker').on('focus', function() { $(this).datepicker('option', 'minDate', '+4d'); $(this).datepicker('show'); }); </script>
KentBrockman Posted May 23, 2014 Author Posted May 23, 2014 Woooha... So easy! Thank you apeisa. Here is the How-To: https://processwire.com/talk/topic/4547-possibility-to-translate-timepicker-addon-on-datepicker/
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