jquery.mtz.monthpicker icon indicating copy to clipboard operation
jquery.mtz.monthpicker copied to clipboard

Standard DateFormat/Localization Support

Open AlexandreArpin opened this issue 11 years ago • 1 comments

Currently, the DateFormat is pretty much baked inside the plugin, with no standard compliance with Localisation and JQuery UI Datepicker.

The way I see it, this plugin should be compatible with JQuery UI Datepicker options and Localisation support (through the i18n plugins)

Which would mean:

  • Short Month Names and Long Month names inside the plugin.
  • Standard DateFormat support (which would mean the day could be included)
  • Year Suffix

(And probably some other things, I am not an expert with Localisation...)

I do not think MonthPicker should depends on the JQuery UI Datepicker plugin, but it'd be nice if their options would be compatible.

Ideally, I would be able to do something like this:

 var options = {
       pattern: $(".datepicker").datepicker("option", "dateFormat");,
       monthNames: $(".datepicker").datepicker("option", "monthNames");
       monthNamesShort: $(".datepicker").datepicker("option", "monthNamesShort");
 };

I realize this might be outside the scope of this plugin, I would appreciate if you could share your vision of this plugin, and if this is the sort of things you'd like to see integrated to it.

AlexandreArpin avatar Jun 25 '13 15:06 AlexandreArpin

Yeap! For now, you could do it this way, in initialization:

$('#your_widget').monthpicker({monthNames: $.datepicker._defaults.monthNamesShort});

About pattern, some regex over $.datepicker._defaults.dateFormat would do the trick too.

At a first look, I can't see any constraint in adding this behaviour if $.datepicker is defined.

lucianocosta avatar Jun 25 '13 22:06 lucianocosta