Skip to content

Commit

Permalink
refactor: interface for locale added
Browse files Browse the repository at this point in the history
  • Loading branch information
shubhadip committed Jan 30, 2022
1 parent e9aa1c6 commit 637d03d
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 11 deletions.
1 change: 0 additions & 1 deletion .eslintcache

This file was deleted.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vuejs3-datepicker",
"version": "0.0.6",
"version": "1.0.2",
"description": "Vue 3 datepicker",
"files": [
"dist/*",
Expand All @@ -19,7 +19,7 @@
"build:lib": "rimraf dist && rollup --config ./build/rollup.config.js",
"test": "jest --config tests/unit/jest.conf.js --coverage ",
"prepublishOnly": "yarn lint && yarn build:lib",
"commit-message": "yarn commitlint -e -V",
"commit-message": "yarn commitlint -e -V",
"semantic-release:local": "yarn run build:lib && yarn build:demo && semantic-release --no-ci",
"semantic-release": "semantic-release"
},
Expand Down
29 changes: 21 additions & 8 deletions src/components/datepicker/locale/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
const af = (): any => {
interface ILocale {
months: string[];
monthsAbbr: string[];
days: string[];
yearSuffix: string;
ymd: boolean;
rtl: boolean;
langName: string;
daysNames: string[];
language: string;
}

const af = (): ILocale => {
const langName = 'Afrikaans';
const monthFullName = [
'Januarie',
Expand Down Expand Up @@ -26,12 +38,13 @@ const af = (): any => {
yearSuffix,
ymd,
rtl,
language: langName,
langName,
daysNames: days,
};
};

const de = (): any => {
const de = (): ILocale => {
const langName = 'German';
const monthFullName = [
'Januar',
Expand Down Expand Up @@ -66,7 +79,7 @@ const de = (): any => {
};
};

const en = (): any => {
const en = (): ILocale => {
const langName = 'English';
const monthFullName = [
'January',
Expand Down Expand Up @@ -101,7 +114,7 @@ const en = (): any => {
};
};

const fr = (): any => {
const fr = (): ILocale => {
const langName = 'Français';
const monthFullName = [
'Janvier',
Expand Down Expand Up @@ -136,7 +149,7 @@ const fr = (): any => {
};
};

const hi = (): any => {
const hi = (): ILocale => {
const langName = 'Hindi';
const monthFullName = [
'जनवरी',
Expand Down Expand Up @@ -171,7 +184,7 @@ const hi = (): any => {
};
};

const ja = (): any => {
const ja = (): ILocale => {
const langName = 'Japanese';
const monthFullName = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'];
const shortName = ['1月', '2月', '3月', '4月', '5月', '6月', '7月', '8月', '9月', '10月', '11月', '12月'];
Expand All @@ -193,7 +206,7 @@ const ja = (): any => {
};
};

const nl = (): any => {
const nl = (): ILocale => {
const langName = 'Dutch';
const monthFullName = [
'januari',
Expand Down Expand Up @@ -222,7 +235,7 @@ const nl = (): any => {
ymd,
rtl,
langName,
// tbd: need fullName of days
language: langName,
daysNames: days,
};
};
Expand Down

0 comments on commit 637d03d

Please sign in to comment.