vendor/assets/javascripts/flatpickr/l10n/cy.js in flatpickr-3.0.7.0 vs vendor/assets/javascripts/flatpickr/l10n/cy.js in flatpickr-4.5.2.0

- old
+ new

@@ -1,36 +1,92 @@ -/* Welsh locals for flatpickr */ -var flatpickr = flatpickr || { l10ns: {} }; -flatpickr.l10ns.cy = {}; +/* flatpickr v4.5.2, @license MIT */ +(function (global, factory) { + typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : + typeof define === 'function' && define.amd ? define(['exports'], factory) : + (factory((global.cy = {}))); +}(this, (function (exports) { 'use strict'; -flatpickr.l10ns.cy.weekdays = { - shorthand: ["Sul", "Llun", "Maw", "Mer", "Iau", "Gwe", "Sad"], - longhand: ["Dydd Sul", "Dydd Llun", "Dydd Mawrth", "Dydd Mercher", "Dydd Iau", "Dydd Gwener", "Dydd Sadwrn"] -}; + const fp = typeof window !== "undefined" && window.flatpickr !== undefined + ? window.flatpickr + : { + l10ns: {}, + }; + const Welsh = { + weekdays: { + shorthand: ["Sul", "Llun", "Maw", "Mer", "Iau", "Gwe", "Sad"], + longhand: [ + "Dydd Sul", + "Dydd Llun", + "Dydd Mawrth", + "Dydd Mercher", + "Dydd Iau", + "Dydd Gwener", + "Dydd Sadwrn", + ], + }, + months: { + shorthand: [ + "Ion", + "Chwef", + "Maw", + "Ebr", + "Mai", + "Meh", + "Gorff", + "Awst", + "Medi", + "Hyd", + "Tach", + "Rhag", + ], + longhand: [ + "Ionawr", + "Chwefror", + "Mawrth", + "Ebrill", + "Mai", + "Mehefin", + "Gorffennaf", + "Awst", + "Medi", + "Hydref", + "Tachwedd", + "Rhagfyr", + ], + }, + firstDayOfWeek: 1, + ordinal: nth => { + if (nth === 1) + return "af"; + if (nth === 2) + return "ail"; + if (nth === 3 || nth === 4) + return "ydd"; + if (nth === 5 || nth === 6) + return "ed"; + if ((nth >= 7 && nth <= 10) || + nth == 12 || + nth == 15 || + nth == 18 || + nth == 20) + return "fed"; + if (nth == 11 || + nth == 13 || + nth == 14 || + nth == 16 || + nth == 17 || + nth == 19) + return "eg"; + if (nth >= 21 && nth <= 39) + return "ain"; + return ""; + }, + }; + fp.l10ns.cy = Welsh; + var cy = fp.l10ns; -flatpickr.l10ns.cy.months = { - shorthand: ["Ion", "Chwef", "Maw", "Ebr", "Mai", "Meh", "Gorff", "Awst", "Medi", "Hyd", "Tach", "Rhag"], - longhand: ["Ionawr", "Chwefror", "Mawrth", "Ebrill", "Mai", "Mehefin", "Gorffennaf", "Awst", "Medi", "Hydref", "Tachwedd", "Rhagfyr"] -}; + exports.Welsh = Welsh; + exports.default = cy; -flatpickr.l10ns.cy.firstDayOfWeek = 1; + Object.defineProperty(exports, '__esModule', { value: true }); -flatpickr.l10ns.cy.ordinal = function (nth) { - if (nth === 1) return "af"; - - if (nth === 2) return "ail"; - - if (nth === 3 || nth === 4) return "ydd"; - - if (nth === 5 || nth === 6) return "ed"; - - if (nth >= 7 && nth <= 10 || nth == 12 || nth == 15 || nth == 18 || nth == 20) return "fed"; - - if (nth == 11 || nth == 13 || nth == 14 || nth == 16 || nth == 17 || nth == 19) return "eg"; - - if (nth >= 21 && nth <= 39) return "ain"; - - // Inconclusive. - return ""; -}; - -if (typeof module !== "undefined") module.exports = flatpickr.l10ns; \ No newline at end of file +})));