@schedule-x/date-picker
Advanced tools
Comparing version 1.3.0 to 1.4.0
@@ -870,18 +870,24 @@ 'use strict'; | ||
class InvalidLocaleError extends Error { | ||
constructor(locale) { | ||
super(`Invalid locale: ${locale}`); | ||
} | ||
} | ||
const datePickerItIT = { | ||
Date: 'Data', | ||
'MM/DD/YYYY': 'DD/MM/YYYY', | ||
'Next month': 'Mese successivo', | ||
'Previous month': 'Mese precedente', | ||
}; | ||
const translate = (locale, languages) => (key) => { | ||
if (!/^[a-z]{2}-[A-Z]{2}$/.test(locale)) | ||
throw new InvalidLocaleError(locale); | ||
const deHyphenatedLocale = locale.replace('-', ''); | ||
const language = languages[deHyphenatedLocale]; | ||
if (!language) | ||
return key; | ||
return language[key] || key; | ||
const calendarItIT = { | ||
Today: 'Oggi', | ||
Month: 'Mese', | ||
Week: 'Settimana', | ||
Day: 'Giorno', | ||
events: 'eventi', | ||
event: 'evento', | ||
'No events': 'Nessun evento', | ||
}; | ||
const itIT = { | ||
...datePickerItIT, | ||
...calendarItIT, | ||
}; | ||
const datePickerEnGB = { | ||
@@ -953,5 +959,22 @@ Date: 'Date', | ||
class InvalidLocaleError extends Error { | ||
constructor(locale) { | ||
super(`Invalid locale: ${locale}`); | ||
} | ||
} | ||
const translate = (locale, languages) => (key) => { | ||
if (!/^[a-z]{2}-[A-Z]{2}$/.test(locale)) | ||
throw new InvalidLocaleError(locale); | ||
const deHyphenatedLocale = locale.replace('-', ''); | ||
const language = languages[deHyphenatedLocale]; | ||
if (!language) | ||
return key; | ||
return language[key] || key; | ||
}; | ||
const translations = { | ||
deDE, | ||
enUS, | ||
itIT, | ||
enGB, | ||
@@ -958,0 +981,0 @@ svSE, |
@@ -870,18 +870,24 @@ 'use strict'; | ||
class InvalidLocaleError extends Error { | ||
constructor(locale) { | ||
super(`Invalid locale: ${locale}`); | ||
} | ||
} | ||
const datePickerItIT = { | ||
Date: 'Data', | ||
'MM/DD/YYYY': 'DD/MM/YYYY', | ||
'Next month': 'Mese successivo', | ||
'Previous month': 'Mese precedente', | ||
}; | ||
const translate = (locale, languages) => (key) => { | ||
if (!/^[a-z]{2}-[A-Z]{2}$/.test(locale)) | ||
throw new InvalidLocaleError(locale); | ||
const deHyphenatedLocale = locale.replace('-', ''); | ||
const language = languages[deHyphenatedLocale]; | ||
if (!language) | ||
return key; | ||
return language[key] || key; | ||
const calendarItIT = { | ||
Today: 'Oggi', | ||
Month: 'Mese', | ||
Week: 'Settimana', | ||
Day: 'Giorno', | ||
events: 'eventi', | ||
event: 'evento', | ||
'No events': 'Nessun evento', | ||
}; | ||
const itIT = { | ||
...datePickerItIT, | ||
...calendarItIT, | ||
}; | ||
const datePickerEnGB = { | ||
@@ -953,5 +959,22 @@ Date: 'Date', | ||
class InvalidLocaleError extends Error { | ||
constructor(locale) { | ||
super(`Invalid locale: ${locale}`); | ||
} | ||
} | ||
const translate = (locale, languages) => (key) => { | ||
if (!/^[a-z]{2}-[A-Z]{2}$/.test(locale)) | ||
throw new InvalidLocaleError(locale); | ||
const deHyphenatedLocale = locale.replace('-', ''); | ||
const language = languages[deHyphenatedLocale]; | ||
if (!language) | ||
return key; | ||
return language[key] || key; | ||
}; | ||
const translations = { | ||
deDE, | ||
enUS, | ||
itIT, | ||
enGB, | ||
@@ -958,0 +981,0 @@ svSE, |
@@ -868,18 +868,24 @@ import { options, createContext, Fragment, render, createElement } from 'preact'; | ||
class InvalidLocaleError extends Error { | ||
constructor(locale) { | ||
super(`Invalid locale: ${locale}`); | ||
} | ||
} | ||
const datePickerItIT = { | ||
Date: 'Data', | ||
'MM/DD/YYYY': 'DD/MM/YYYY', | ||
'Next month': 'Mese successivo', | ||
'Previous month': 'Mese precedente', | ||
}; | ||
const translate = (locale, languages) => (key) => { | ||
if (!/^[a-z]{2}-[A-Z]{2}$/.test(locale)) | ||
throw new InvalidLocaleError(locale); | ||
const deHyphenatedLocale = locale.replace('-', ''); | ||
const language = languages[deHyphenatedLocale]; | ||
if (!language) | ||
return key; | ||
return language[key] || key; | ||
const calendarItIT = { | ||
Today: 'Oggi', | ||
Month: 'Mese', | ||
Week: 'Settimana', | ||
Day: 'Giorno', | ||
events: 'eventi', | ||
event: 'evento', | ||
'No events': 'Nessun evento', | ||
}; | ||
const itIT = { | ||
...datePickerItIT, | ||
...calendarItIT, | ||
}; | ||
const datePickerEnGB = { | ||
@@ -951,5 +957,22 @@ Date: 'Date', | ||
class InvalidLocaleError extends Error { | ||
constructor(locale) { | ||
super(`Invalid locale: ${locale}`); | ||
} | ||
} | ||
const translate = (locale, languages) => (key) => { | ||
if (!/^[a-z]{2}-[A-Z]{2}$/.test(locale)) | ||
throw new InvalidLocaleError(locale); | ||
const deHyphenatedLocale = locale.replace('-', ''); | ||
const language = languages[deHyphenatedLocale]; | ||
if (!language) | ||
return key; | ||
return language[key] || key; | ||
}; | ||
const translations = { | ||
deDE, | ||
enUS, | ||
itIT, | ||
enGB, | ||
@@ -956,0 +979,0 @@ svSE, |
@@ -870,18 +870,24 @@ (function (global, factory) { | ||
class InvalidLocaleError extends Error { | ||
constructor(locale) { | ||
super(`Invalid locale: ${locale}`); | ||
} | ||
} | ||
const datePickerItIT = { | ||
Date: 'Data', | ||
'MM/DD/YYYY': 'DD/MM/YYYY', | ||
'Next month': 'Mese successivo', | ||
'Previous month': 'Mese precedente', | ||
}; | ||
const translate = (locale, languages) => (key) => { | ||
if (!/^[a-z]{2}-[A-Z]{2}$/.test(locale)) | ||
throw new InvalidLocaleError(locale); | ||
const deHyphenatedLocale = locale.replace('-', ''); | ||
const language = languages[deHyphenatedLocale]; | ||
if (!language) | ||
return key; | ||
return language[key] || key; | ||
const calendarItIT = { | ||
Today: 'Oggi', | ||
Month: 'Mese', | ||
Week: 'Settimana', | ||
Day: 'Giorno', | ||
events: 'eventi', | ||
event: 'evento', | ||
'No events': 'Nessun evento', | ||
}; | ||
const itIT = { | ||
...datePickerItIT, | ||
...calendarItIT, | ||
}; | ||
const datePickerEnGB = { | ||
@@ -953,5 +959,22 @@ Date: 'Date', | ||
class InvalidLocaleError extends Error { | ||
constructor(locale) { | ||
super(`Invalid locale: ${locale}`); | ||
} | ||
} | ||
const translate = (locale, languages) => (key) => { | ||
if (!/^[a-z]{2}-[A-Z]{2}$/.test(locale)) | ||
throw new InvalidLocaleError(locale); | ||
const deHyphenatedLocale = locale.replace('-', ''); | ||
const language = languages[deHyphenatedLocale]; | ||
if (!language) | ||
return key; | ||
return language[key] || key; | ||
}; | ||
const translations = { | ||
deDE, | ||
enUS, | ||
itIT, | ||
enGB, | ||
@@ -958,0 +981,0 @@ svSE, |
{ | ||
"name": "@schedule-x/date-picker", | ||
"version": "1.3.0", | ||
"version": "1.4.0", | ||
"description": "Schedule-X date picker component", | ||
@@ -33,3 +33,3 @@ "author": { | ||
"homepage": "https://schedule-x.dev", | ||
"gitHead": "b00c5c989e877d5451829ca58d9162992c5d85f5" | ||
"gitHead": "d2dc237f52dfccb30ef98fc06a1b8941cde820b6" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
157022
4115