calendar.phtml 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. // no notice of license for now
  7. ?>
  8. <?php
  9. /**
  10. * Calendar localization script. Should be put into page header.
  11. *
  12. * @see \Magento\Framework\View\Element\Html\Calendar
  13. */
  14. ?>
  15. <script>
  16. require([
  17. "jquery",
  18. "jquery/ui"
  19. ], function($){
  20. $.extend(true, $, {
  21. calendarConfig: {
  22. dayNames: <?= /* @escapeNotVerified */ $days['wide'] ?>,
  23. dayNamesMin: <?= /* @escapeNotVerified */ $days['abbreviated'] ?>,
  24. monthNames: <?= /* @escapeNotVerified */ $months['wide'] ?>,
  25. monthNamesShort: <?= /* @escapeNotVerified */ $months['abbreviated'] ?>,
  26. infoTitle: "<?= /* @escapeNotVerified */ __('About the calendar') ?>",
  27. firstDay: <?= /* @escapeNotVerified */ $firstDay ?>,
  28. closeText: "<?= /* @escapeNotVerified */ __('Close') ?>",
  29. currentText: "<?= /* @escapeNotVerified */ __('Go Today') ?>",
  30. prevText: "<?= /* @escapeNotVerified */ __('Previous') ?>",
  31. nextText: "<?= /* @escapeNotVerified */ __('Next') ?>",
  32. weekHeader: "<?= /* @escapeNotVerified */ __('WK') ?>",
  33. timeText: "<?= /* @escapeNotVerified */ __('Time') ?>",
  34. hourText: "<?= /* @escapeNotVerified */ __('Hour') ?>",
  35. minuteText: "<?= /* @escapeNotVerified */ __('Minute') ?>",
  36. dateFormat: $.datepicker.RFC_2822,
  37. showOn: "button",
  38. showAnim: "",
  39. changeMonth: true,
  40. changeYear: true,
  41. buttonImageOnly: null,
  42. buttonImage: null,
  43. showButtonPanel: true,
  44. showOtherMonths: true,
  45. showWeek: false,
  46. timeFormat: '',
  47. showTime: false,
  48. showHour: false,
  49. showMinute: false,
  50. serverTimezoneSeconds: <?= (int) $block->getStoreTimestamp() ?>,
  51. serverTimezoneOffset: <?= (int) $block->getTimezoneOffsetSeconds() ?>,
  52. yearRange: '<?= /* @escapeNotVerified */ $block->getYearRange() ?>'
  53. }
  54. });
  55. enUS = <?= /* @escapeNotVerified */ $enUS ?>; // en_US locale reference
  56. });
  57. </script>