Jump to content

InputfieldDatetime / Datepicker - First ay Monday


KentBrockman
 Share

Recommended Posts

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!

Link to comment
Share on other sites

  • 4 weeks later...

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).

  • Like 2
Link to comment
Share on other sites

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>
Link to comment
Share on other sites

  • 2 weeks later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...