Search and Top Navigation
#6682 closed feature (fixed)
Opened November 22, 2010 02:27PM UTC
Closed June 16, 2014 02:43PM UTC
Datepicker: No explicit en or en-US regional settings for datepicker
Reported by: | cim | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | 1.11.0 |
Component: | ui.datepicker | Version: | 1.8.6 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Although datepicker defaults to US English regional settings there is no explicit regional setting for en-US, or for that matter for en. This makes it a little more fiddly if you are trying to write an application that sets the datepicker regional setting according to the browser's accept-language settings. If the browser language is set to en or en-US then you have to do something special.
It would be nice if there were explicit regional settings for en and en-US and I suggest the following:
/* English (defaults to US) initialisation for the jQuery UI date picker plugin. */ jQuery(function($){ $.datepicker.regional['en'] = { closeText: 'Done', prevText: 'Prev', nextText: 'Next', currentText: 'Today', monthNames: ['January','February','March','April','May','June', 'July','August','September','October','November','December'], monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], weekHeader: 'Wk', dateFormat: 'mm/dd/yy', firstDay: 1, isRTL: false, showMonthAfterYear: false, yearSuffix: ''}; $.datepicker.setDefaults($.datepicker.regional['en']); }); /* US English initialisation for the jQuery UI date picker plugin. */ jQuery(function($){ $.datepicker.regional['en-US'] = { closeText: 'Done', prevText: 'Prev', nextText: 'Next', currentText: 'Today', monthNames: ['January','February','March','April','May','June', 'July','August','September','October','November','December'], monthNamesShort: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'], dayNames: ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'], dayNamesShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], dayNamesMin: ['Su','Mo','Tu','We','Th','Fr','Sa'], weekHeader: 'Wk', dateFormat: 'mm/dd/yy', firstDay: 1, isRTL: false, showMonthAfterYear: false, yearSuffix: ''}; $.datepicker.setDefaults($.datepicker.regional['en-US']); });
Campbell
Attachments (0)
Change History (6)
Changed January 11, 2011 09:37AM UTC by comment:1
Changed June 17, 2012 10:29AM UTC by comment:2
Will this ever get addressed/included in JQuery UI Datepicker? We too really need this. Now it's down to if..else.. conditions or manually including Campbell's code in our localization JS files.
Changed June 26, 2012 01:22AM UTC by comment:3
type: | enhancement → feature |
---|
Changed October 11, 2012 02:43PM UTC by comment:4
milestone: | 1.9.0 → 1.11.0 |
---|
Changed October 16, 2012 09:18PM UTC by comment:5
status: | new → open |
---|---|
summary: | No explicit en or en-US regional settings for datepicker → Datepicker: No explicit en or en-US regional settings for datepicker |
See also ticket #6828