Reputation: 3
I am using a WordPress plugin called HBook which is a searchable availability calendar for hotels. It uses a jquery datepicker. The developer's localization file for the datepicker is making the week start on Monday. My client is in the US and needs the week to start on Sunday. Is there a jquery snippet or something else I could add to my theme to override the "firstDay" in the localization file? I've tried messing around with it but I am not so great with jquery.
I asked the plugin developer if there was a way to do this, but he said there was not. He said I would just have to change the plugin file. I'd rather not do this since I will lose my changes with future releases. He did say he would consider adding this feature to the plugin settings page in a future release, but he had no guess on when this would be.
Here is the plugin's localization file.
If this is just not possible I would appreciate someone telling me that so I can move on! thanks!
Upvotes: 0
Views: 359
Reputation: 232
As explained in the documentation, you can initialize the datepicker with the firstDay
option specified:
jQuery( ".selector" ).datepicker({
firstDay: 0
});
If you want to change it after initialization, you can use
jQuery( ".selector" ).datepicker( "option", "firstDay", 0 );
Here is the code for your custom.js file:
jQuery(document).ready(function() {
jQuery('.hb-input-datepicker').on("focus", function() {
jQuery(this).datepicker( "option", "firstDay", 0 );
});
});
Upvotes: 1