From 637d03d0d0cead6dcc7eeec1947454b62c09cd56 Mon Sep 17 00:00:00 2001 From: shubhadip Date: Sun, 30 Jan 2022 19:06:45 +0530 Subject: [PATCH] refactor: interface for locale added --- .eslintcache | 1 - package.json | 4 ++-- src/components/datepicker/locale/index.ts | 29 ++++++++++++++++------- 3 files changed, 23 insertions(+), 11 deletions(-) delete mode 100644 .eslintcache diff --git a/.eslintcache b/.eslintcache deleted file mode 100644 index 2c2fd77..0000000 --- a/.eslintcache +++ /dev/null @@ -1 +0,0 @@ -[{"/Users/shubhadipmaity/projects/vuejs3-datepicker/src/App.vue":"1","/Users/shubhadipmaity/projects/vuejs3-datepicker/src/components/wrapper/Wrapper.vue":"2"},{"size":3930,"mtime":1641549258180,"results":"3","hashOfConfig":"4"},{"size":1341,"mtime":1641549258181,"results":"5","hashOfConfig":"4"},{"filePath":"6","messages":"7","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"1g6avd8",{"filePath":"8","messages":"9","errorCount":0,"warningCount":0,"fixableErrorCount":0,"fixableWarningCount":0},"/Users/shubhadipmaity/projects/vuejs3-datepicker/src/App.vue",[],"/Users/shubhadipmaity/projects/vuejs3-datepicker/src/components/wrapper/Wrapper.vue",[]] \ No newline at end of file diff --git a/package.json b/package.json index 6725f4f..517efd5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vuejs3-datepicker", - "version": "0.0.6", + "version": "1.0.2", "description": "Vue 3 datepicker", "files": [ "dist/*", @@ -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" }, diff --git a/src/components/datepicker/locale/index.ts b/src/components/datepicker/locale/index.ts index 3b0eada..860cd6f 100644 --- a/src/components/datepicker/locale/index.ts +++ b/src/components/datepicker/locale/index.ts @@ -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', @@ -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', @@ -66,7 +79,7 @@ const de = (): any => { }; }; -const en = (): any => { +const en = (): ILocale => { const langName = 'English'; const monthFullName = [ 'January', @@ -101,7 +114,7 @@ const en = (): any => { }; }; -const fr = (): any => { +const fr = (): ILocale => { const langName = 'Français'; const monthFullName = [ 'Janvier', @@ -136,7 +149,7 @@ const fr = (): any => { }; }; -const hi = (): any => { +const hi = (): ILocale => { const langName = 'Hindi'; const monthFullName = [ 'जनवरी', @@ -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月']; @@ -193,7 +206,7 @@ const ja = (): any => { }; }; -const nl = (): any => { +const nl = (): ILocale => { const langName = 'Dutch'; const monthFullName = [ 'januari', @@ -222,7 +235,7 @@ const nl = (): any => { ymd, rtl, langName, - // tbd: need fullName of days + language: langName, daysNames: days, }; };