locale.datepicker.js 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. (function ($) {
  2. /**
  3. * Attaches language support to the jQuery UI datepicker component.
  4. */
  5. Drupal.behaviors.localeDatepicker = {
  6. attach: function(context, settings) {
  7. // This code accesses Drupal.settings and localized strings via Drupal.t().
  8. // So this code should run after these are initialized. By placing it in an
  9. // attach behavior this is assured.
  10. $.datepicker.regional['drupal-locale'] = $.extend({
  11. closeText: Drupal.t('Done'),
  12. prevText: Drupal.t('Prev'),
  13. nextText: Drupal.t('Next'),
  14. currentText: Drupal.t('Today'),
  15. monthNames: [
  16. Drupal.t('January'),
  17. Drupal.t('February'),
  18. Drupal.t('March'),
  19. Drupal.t('April'),
  20. Drupal.t('May'),
  21. Drupal.t('June'),
  22. Drupal.t('July'),
  23. Drupal.t('August'),
  24. Drupal.t('September'),
  25. Drupal.t('October'),
  26. Drupal.t('November'),
  27. Drupal.t('December')
  28. ],
  29. monthNamesShort: [
  30. Drupal.t('Jan'),
  31. Drupal.t('Feb'),
  32. Drupal.t('Mar'),
  33. Drupal.t('Apr'),
  34. Drupal.t('May'),
  35. Drupal.t('Jun'),
  36. Drupal.t('Jul'),
  37. Drupal.t('Aug'),
  38. Drupal.t('Sep'),
  39. Drupal.t('Oct'),
  40. Drupal.t('Nov'),
  41. Drupal.t('Dec')
  42. ],
  43. dayNames: [
  44. Drupal.t('Sunday'),
  45. Drupal.t('Monday'),
  46. Drupal.t('Tuesday'),
  47. Drupal.t('Wednesday'),
  48. Drupal.t('Thursday'),
  49. Drupal.t('Friday'),
  50. Drupal.t('Saturday')
  51. ],
  52. dayNamesShort: [
  53. Drupal.t('Sun'),
  54. Drupal.t('Mon'),
  55. Drupal.t('Tue'),
  56. Drupal.t('Wed'),
  57. Drupal.t('Thu'),
  58. Drupal.t('Fri'),
  59. Drupal.t('Sat')
  60. ],
  61. dayNamesMin: [
  62. Drupal.t('Su'),
  63. Drupal.t('Mo'),
  64. Drupal.t('Tu'),
  65. Drupal.t('We'),
  66. Drupal.t('Th'),
  67. Drupal.t('Fr'),
  68. Drupal.t('Sa')
  69. ],
  70. dateFormat: Drupal.t('mm/dd/yy'),
  71. firstDay: 0,
  72. isRTL: 0
  73. }, Drupal.settings.jquery.ui.datepicker);
  74. $.datepicker.setDefaults($.datepicker.regional['drupal-locale']);
  75. }
  76. };
  77. })(jQuery);