-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
25353a7
commit aaa8de8
Showing
75 changed files
with
3,993 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,17 @@ | ||
<!-- classList polyfill for IE9 --> | ||
<script src="https://cdnjs.cloudflare.com/ajax/libs/classlist/1.2.20171210/classList.min.js"></script> | ||
|
||
<script src="https://cdn.jsdelivr.net/npm/flatpickr"></script> | ||
<script> | ||
// Dynamically load the javascript file as per the user language preference | ||
function loadScript(fileUrl, async = true) { | ||
let scriptElement = document.createElement("script"); | ||
|
||
scriptElement.setAttribute("src", fileUrl); | ||
scriptElement.setAttribute("type", "text/javascript"); | ||
scriptElement.setAttribute("async", async); | ||
document.body.appendChild(scriptElement); | ||
// error event | ||
scriptElement.addEventListener("error", () => { | ||
console.log(`Error on loading file ${fileUrl}`); | ||
}); | ||
} | ||
const userLanguage = (navigator.language || navigator.userLanguage).split('-')[0]; | ||
if(userLanguage !== 'en') { | ||
loadScript(`https://npmcdn.com/flatpickr/dist/l10n/${userLanguage}.js`, true); | ||
} | ||
</script> | ||
<script id="datetimepicker-js" type="module"> | ||
import datetimepicker from "./js/modules/datetimepicker.js"; | ||
datetimepicker.initializeFlatpickr(); | ||
import "./enable-node-libs/flatpickr/dist/flatpickr.min.js"; | ||
const userLanguage = (navigator.language || navigator.userLanguage).split('-')[0]; | ||
console.log(`lang: ${userLanguage}`); | ||
if(userLanguage !== 'en') { | ||
import(`./enable-node-libs/flatpickr/dist/esm/l10n/${userLanguage}.js`) | ||
.then((s) => { | ||
console.log('s', flatpickr.l10ns) | ||
datetimepicker.initializeFlatpickr(); | ||
}) | ||
} else { | ||
datetimepicker.initializeFlatpickr(); | ||
} | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
var fp = typeof window !== "undefined" && window.flatpickr !== undefined | ||
? window.flatpickr | ||
: { | ||
l10ns: {}, | ||
}; | ||
export var AlgerianArabic = { | ||
weekdays: { | ||
shorthand: ["أحد", "اثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت"], | ||
longhand: [ | ||
"الأحد", | ||
"الاثنين", | ||
"الثلاثاء", | ||
"الأربعاء", | ||
"الخميس", | ||
"الجمعة", | ||
"السبت", | ||
], | ||
}, | ||
months: { | ||
shorthand: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"], | ||
longhand: [ | ||
"جانفي", | ||
"فيفري", | ||
"مارس", | ||
"أفريل", | ||
"ماي", | ||
"جوان", | ||
"جويليه", | ||
"أوت", | ||
"سبتمبر", | ||
"أكتوبر", | ||
"نوفمبر", | ||
"ديسمبر", | ||
], | ||
}, | ||
firstDayOfWeek: 0, | ||
rangeSeparator: " إلى ", | ||
weekAbbreviation: "Wk", | ||
scrollTitle: "قم بالتمرير للزيادة", | ||
toggleTitle: "اضغط للتبديل", | ||
yearAriaLabel: "سنة", | ||
monthAriaLabel: "شهر", | ||
hourAriaLabel: "ساعة", | ||
minuteAriaLabel: "دقيقة", | ||
time_24hr: true, | ||
}; | ||
fp.l10ns.ar = AlgerianArabic; | ||
export default fp.l10ns; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
var fp = typeof window !== "undefined" && window.flatpickr !== undefined | ||
? window.flatpickr | ||
: { | ||
l10ns: {}, | ||
}; | ||
export var Arabic = { | ||
weekdays: { | ||
shorthand: ["أحد", "اثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت"], | ||
longhand: [ | ||
"الأحد", | ||
"الاثنين", | ||
"الثلاثاء", | ||
"الأربعاء", | ||
"الخميس", | ||
"الجمعة", | ||
"السبت", | ||
], | ||
}, | ||
months: { | ||
shorthand: ["1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"], | ||
longhand: [ | ||
"يناير", | ||
"فبراير", | ||
"مارس", | ||
"أبريل", | ||
"مايو", | ||
"يونيو", | ||
"يوليو", | ||
"أغسطس", | ||
"سبتمبر", | ||
"أكتوبر", | ||
"نوفمبر", | ||
"ديسمبر", | ||
], | ||
}, | ||
firstDayOfWeek: 6, | ||
rangeSeparator: " إلى ", | ||
weekAbbreviation: "Wk", | ||
scrollTitle: "قم بالتمرير للزيادة", | ||
toggleTitle: "اضغط للتبديل", | ||
amPM: ["ص", "م"], | ||
yearAriaLabel: "سنة", | ||
monthAriaLabel: "شهر", | ||
hourAriaLabel: "ساعة", | ||
minuteAriaLabel: "دقيقة", | ||
time_24hr: false, | ||
}; | ||
fp.l10ns.ar = Arabic; | ||
export default fp.l10ns; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
var fp = typeof window !== "undefined" && window.flatpickr !== undefined | ||
? window.flatpickr | ||
: { | ||
l10ns: {}, | ||
}; | ||
export var Austria = { | ||
weekdays: { | ||
shorthand: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"], | ||
longhand: [ | ||
"Sonntag", | ||
"Montag", | ||
"Dienstag", | ||
"Mittwoch", | ||
"Donnerstag", | ||
"Freitag", | ||
"Samstag", | ||
], | ||
}, | ||
months: { | ||
shorthand: [ | ||
"Jän", | ||
"Feb", | ||
"Mär", | ||
"Apr", | ||
"Mai", | ||
"Jun", | ||
"Jul", | ||
"Aug", | ||
"Sep", | ||
"Okt", | ||
"Nov", | ||
"Dez", | ||
], | ||
longhand: [ | ||
"Jänner", | ||
"Februar", | ||
"März", | ||
"April", | ||
"Mai", | ||
"Juni", | ||
"Juli", | ||
"August", | ||
"September", | ||
"Oktober", | ||
"November", | ||
"Dezember", | ||
], | ||
}, | ||
firstDayOfWeek: 1, | ||
weekAbbreviation: "KW", | ||
rangeSeparator: " bis ", | ||
scrollTitle: "Zum Ändern scrollen", | ||
toggleTitle: "Zum Umschalten klicken", | ||
time_24hr: true, | ||
}; | ||
fp.l10ns.at = Austria; | ||
export default fp.l10ns; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
var fp = typeof window !== "undefined" && window.flatpickr !== undefined | ||
? window.flatpickr | ||
: { | ||
l10ns: {}, | ||
}; | ||
export var Azerbaijan = { | ||
weekdays: { | ||
shorthand: ["B.", "B.e.", "Ç.a.", "Ç.", "C.a.", "C.", "Ş."], | ||
longhand: [ | ||
"Bazar", | ||
"Bazar ertəsi", | ||
"Çərşənbə axşamı", | ||
"Çərşənbə", | ||
"Cümə axşamı", | ||
"Cümə", | ||
"Şənbə", | ||
], | ||
}, | ||
months: { | ||
shorthand: [ | ||
"Yan", | ||
"Fev", | ||
"Mar", | ||
"Apr", | ||
"May", | ||
"İyn", | ||
"İyl", | ||
"Avq", | ||
"Sen", | ||
"Okt", | ||
"Noy", | ||
"Dek", | ||
], | ||
longhand: [ | ||
"Yanvar", | ||
"Fevral", | ||
"Mart", | ||
"Aprel", | ||
"May", | ||
"İyun", | ||
"İyul", | ||
"Avqust", | ||
"Sentyabr", | ||
"Oktyabr", | ||
"Noyabr", | ||
"Dekabr", | ||
], | ||
}, | ||
firstDayOfWeek: 1, | ||
ordinal: function () { | ||
return "."; | ||
}, | ||
rangeSeparator: " - ", | ||
weekAbbreviation: "Hf", | ||
scrollTitle: "Artırmaq üçün sürüşdürün", | ||
toggleTitle: "Aç / Bağla", | ||
amPM: ["GƏ", "GS"], | ||
time_24hr: true, | ||
}; | ||
fp.l10ns.az = Azerbaijan; | ||
export default fp.l10ns; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
var fp = typeof window !== "undefined" && window.flatpickr !== undefined | ||
? window.flatpickr | ||
: { | ||
l10ns: {}, | ||
}; | ||
export var Belarusian = { | ||
weekdays: { | ||
shorthand: ["Нд", "Пн", "Аў", "Ср", "Чц", "Пт", "Сб"], | ||
longhand: [ | ||
"Нядзеля", | ||
"Панядзелак", | ||
"Аўторак", | ||
"Серада", | ||
"Чацвер", | ||
"Пятніца", | ||
"Субота", | ||
], | ||
}, | ||
months: { | ||
shorthand: [ | ||
"Сту", | ||
"Лют", | ||
"Сак", | ||
"Кра", | ||
"Тра", | ||
"Чэр", | ||
"Ліп", | ||
"Жні", | ||
"Вер", | ||
"Кас", | ||
"Ліс", | ||
"Сне", | ||
], | ||
longhand: [ | ||
"Студзень", | ||
"Люты", | ||
"Сакавік", | ||
"Красавік", | ||
"Травень", | ||
"Чэрвень", | ||
"Ліпень", | ||
"Жнівень", | ||
"Верасень", | ||
"Кастрычнік", | ||
"Лістапад", | ||
"Снежань", | ||
], | ||
}, | ||
firstDayOfWeek: 1, | ||
ordinal: function () { | ||
return ""; | ||
}, | ||
rangeSeparator: " — ", | ||
weekAbbreviation: "Тыд.", | ||
scrollTitle: "Пракруціце для павелічэння", | ||
toggleTitle: "Націсніце для пераключэння", | ||
amPM: ["ДП", "ПП"], | ||
yearAriaLabel: "Год", | ||
time_24hr: true, | ||
}; | ||
fp.l10ns.be = Belarusian; | ||
export default fp.l10ns; |
Oops, something went wrong.