From 398b98aa0b0c9628a44c6470b605febab53b82d6 Mon Sep 17 00:00:00 2001 From: Efren James Centeno Date: Wed, 16 Aug 2023 22:00:08 +0800 Subject: [PATCH 1/5] =?UTF-8?q?=F0=9F=94=80=20chore(package.json):=20updat?= =?UTF-8?q?e=20date-fns=20dependency=20to=20version=20^2.30.0=20for=20comp?= =?UTF-8?q?atibility=20and=20potential=20bug=20fixes=20The=20date-fns=20de?= =?UTF-8?q?pendency=20has=20been=20updated=20to=20version=20^2.30.0=20to?= =?UTF-8?q?=20ensure=20compatibility=20with=20the=20latest=20features=20an?= =?UTF-8?q?d=20bug=20fixes.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- yarn.lock | 22 ++++++++++++++++++---- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index c67db41..725a327 100644 --- a/package.json +++ b/package.json @@ -26,7 +26,7 @@ }, "dependencies": { "cryptiles": "^4.1.3", - "date-fns": "1.30.1", + "date-fns": "^2.30.0", "deep-extend": "^0.6.0", "filesize": "^6.1.0", "fstream": "^1.0.12", diff --git a/yarn.lock b/yarn.lock index 9fa90fe..9a60778 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1037,6 +1037,13 @@ "@babel/plugin-transform-typeof-symbol" "7.0.0-beta.53" "@babel/plugin-transform-unicode-regex" "7.0.0-beta.53" +"@babel/runtime@^7.21.0": + version "7.22.10" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.22.10.tgz#ae3e9631fd947cb7e3610d3e9d8fef5f76696682" + integrity sha512-21t/fkKLMZI4pqP2wlmsQAWnYW1PDyKyyUV4vCi+B25ydmdaYTKXPwCj0BzSUnZf4seIiYvSA3jcZ3gdsMFkLQ== + dependencies: + regenerator-runtime "^0.14.0" + "@babel/runtime@^7.7.5": version "7.7.7" resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.7.7.tgz#194769ca8d6d7790ec23605af9ee3e42a0aa79cf" @@ -2560,10 +2567,12 @@ data-urls@^1.0.0: whatwg-mimetype "^2.2.0" whatwg-url "^7.0.0" -date-fns@1.30.1: - version "1.30.1" - resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-1.30.1.tgz#2e71bf0b119153dbb4cc4e88d9ea5acfb50dc05c" - integrity sha512-hBSVCvSmWC+QypYObzwGOd9wqdDpOt+0wl0KbU+R+uuZBS1jN8VsD1ss3irQDknRj5NvxiTF6oj/nDRnN/UQNw== +date-fns@^2.30.0: + version "2.30.0" + resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.30.0.tgz#f367e644839ff57894ec6ac480de40cae4b0f4d0" + integrity sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw== + dependencies: + "@babel/runtime" "^7.21.0" de-indent@^1.0.2: version "1.0.2" @@ -5982,6 +5991,11 @@ regenerator-runtime@^0.13.2: resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.3.tgz#7cf6a77d8f5c6f60eb73c5fc1955b2ceb01e6bf5" integrity sha512-naKIZz2GQ8JWh///G7L3X6LaQUAMp2lvb1rvwwsURe/VXwD6VMfr+/1NuNw3ag8v2kY1aQ/go5SNn79O9JU7yw== +regenerator-runtime@^0.14.0: + version "0.14.0" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz#5e19d68eb12d486f797e15a3c6a918f7cec5eb45" + integrity sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA== + regenerator-transform@^0.13.3: version "0.13.4" resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.13.4.tgz#18f6763cf1382c69c36df76c6ce122cc694284fb" From f02d16ae55ba077b3ab1f309e2c5604721ff5ff4 Mon Sep 17 00:00:00 2001 From: Efren James Centeno Date: Wed, 16 Aug 2023 22:11:40 +0800 Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=90=9B=20fix(date-format.test.js):=20?= =?UTF-8?q?fix=20date=20format=20in=20test=20case=20to=20match=20the=20exp?= =?UTF-8?q?ected=20output=20The=20date=20format=20in=20the=20test=20case?= =?UTF-8?q?=20was=20incorrect.=20It=20was=20using=20'YYYY'=20instead=20of?= =?UTF-8?q?=20'yyyy'=20for=20the=20year=20format.=20This=20caused=20the=20?= =?UTF-8?q?test=20to=20fail.=20The=20date=20format=20has=20been=20fixed=20?= =?UTF-8?q?to=20'MMM=20dd,=20yyyy'=20to=20match=20the=20expected=20output.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/filters/date/date-format.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/filters/date/date-format.test.js b/src/filters/date/date-format.test.js index 520fd95..8dbe81c 100644 --- a/src/filters/date/date-format.test.js +++ b/src/filters/date/date-format.test.js @@ -10,5 +10,5 @@ it('adds a $morphDate method to the Vue prototype', () => { it('should format date', () => { const localVue = createLocalVue(); localVue.use(dateFormat); - expect(localVue.prototype.$morphDateFormat(new Date(2017, 6, 26), 'MMM DD, YYYY')).toEqual('Jul 26, 2017'); + expect(localVue.prototype.$morphDateFormat(new Date(2017, 6, 26), 'MMM dd, yyyy')).toEqual('Jul 26, 2017'); }); From 70845c1acb19d7ecde3da14632c57f41409dee12 Mon Sep 17 00:00:00 2001 From: Efren James Centeno Date: Wed, 16 Aug 2023 22:12:04 +0800 Subject: [PATCH 3/5] =?UTF-8?q?=F0=9F=93=9D=20docs(DOC.md):=20update=20dat?= =?UTF-8?q?e-fns=20version=20and=20fix=20date=20format=20examples=20?= =?UTF-8?q?=F0=9F=93=9A=20chore(DOC.md):=20update=20link=20to=20date-fns?= =?UTF-8?q?=20format=20documentation=20The=20`morph-date-format`=20functio?= =?UTF-8?q?n=20in=20the=20DOC.md=20file=20has=20been=20updated=20to=20use?= =?UTF-8?q?=20`date-fns@v2.30.0`=20instead=20of=20`date-fns@v1.30.1`.=20Th?= =?UTF-8?q?is=20update=20ensures=20compatibility=20with=20the=20latest=20v?= =?UTF-8?q?ersion=20of=20`date-fns`=20and=20provides=20access=20to=20the?= =?UTF-8?q?=20latest=20features?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DOC.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/DOC.md b/DOC.md index b986b24..42eca4d 100644 --- a/DOC.md +++ b/DOC.md @@ -230,25 +230,25 @@ Format any valid date using date-fns' `format()` function. `morph-date-format(format)` -*Note* - `morph-date-format` is now using using [`date-fns@v1.30.1`](https://date-fns.org/). +*Note* - `morph-date-format` is now using using [`date-fns@v2.30.0`](https://date-fns.org/). ```html -

{{ new Date() | morph-date-format('MMM DD, YYYY') }}

+

{{ new Date() | morph-date-format('MMM dd, yyyy') }}

-

{{ new Date() | morph-date-format('YYYY') }}

+

{{ new Date() | morph-date-format('yyyy') }}

-

{{ new Date() | morph-date-format('[Today is a] dddd') }}

+

{{ new Date() | morph-date-format('[Today is a] EEEE') }}

``` ```javascript const date = new Date('1976-03-20'); -const formatted = this.$morphDateFormat(date, 'MMM DD, YYYY'); -const year = this.$morphDateFormat(date, 'YYYY'); -const time = this.$morphDateFormat(new Date(), 'hh:mm A'); +const formatted = this.$morphDateFormat(date, 'MMM dd, yyyy'); +const year = this.$morphDateFormat(date, 'yyyy'); +const time = this.$morphDateFormat(new Date(), 'hh:mm a..aa'); console.log(formatted); // Mar 20, 1976 console.log(year); // 1976 @@ -257,7 +257,7 @@ console.log(time); // 11:00 PM **API** -All formats are available of course in the [date-fns format documentation](https://date-fns.org/v1.30.1/docs/format), but here are some common examples. +All formats are available of course in the [date-fns format documentation](https://date-fns.org/v2.30.0/docs/format), but here are some common examples. [Back to top](#filters) From 49f0f94c0a3694de37fdbf8e1794b17f265d45ab Mon Sep 17 00:00:00 2001 From: Efren James Centeno Date: Wed, 16 Aug 2023 23:53:53 +0800 Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=94=80=20chore(age.test.js):=20update?= =?UTF-8?q?=20CHESTER=5FBENNINGTON=5FAGE=20constant=20to=20reflect=20the?= =?UTF-8?q?=20correct=20age=20The=20constant=20CHESTER=5FBENNINGTON=5FAGE?= =?UTF-8?q?=20has=20been=20updated=20from=2044=20to=2047=20to=20reflect=20?= =?UTF-8?q?the=20correct=20age=20of=20Chester=20Bennington.=20This=20chang?= =?UTF-8?q?e=20ensures=20that=20the=20test=20case=20accurately=20represent?= =?UTF-8?q?s=20the=20expected=20age.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/filters/age/age.test.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/filters/age/age.test.js b/src/filters/age/age.test.js index bc3e3cc..8a4036b 100644 --- a/src/filters/age/age.test.js +++ b/src/filters/age/age.test.js @@ -1,6 +1,6 @@ import { createLocalVue } from '@vue/test-utils'; import { age } from './age'; -const CHESTER_BENNINGTON_AGE = 44; +const CHESTER_BENNINGTON_AGE = 47; it('adds a $morphAge method to the Vue prototype', () => { const localVue = createLocalVue(); From 4b01b74d6b1cbe3ad8a83fb23d9ba3ce871701b0 Mon Sep 17 00:00:00 2001 From: Efren James Centeno Date: Thu, 17 Aug 2023 00:01:08 +0800 Subject: [PATCH 5/5] =?UTF-8?q?=F0=9F=90=9B=20fix(DOC.md):=20remove=20unne?= =?UTF-8?q?cessary=20dots=20in=20the=20time=20format=20to=20fix=20incorrec?= =?UTF-8?q?t=20time=20display=20The=20unnecessary=20dots=20in=20the=20time?= =?UTF-8?q?=20format=20have=20been=20removed=20to=20fix=20the=20incorrect?= =?UTF-8?q?=20time=20display.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- DOC.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DOC.md b/DOC.md index 42eca4d..528b3de 100644 --- a/DOC.md +++ b/DOC.md @@ -248,7 +248,7 @@ const date = new Date('1976-03-20'); const formatted = this.$morphDateFormat(date, 'MMM dd, yyyy'); const year = this.$morphDateFormat(date, 'yyyy'); -const time = this.$morphDateFormat(new Date(), 'hh:mm a..aa'); +const time = this.$morphDateFormat(new Date(), 'hh:mm a'); console.log(formatted); // Mar 20, 1976 console.log(year); // 1976