Skip to content

Commit

Permalink
Merge pull request #53 from ejcenteno/chore-update-date-fns
Browse files Browse the repository at this point in the history
🔀 chore(package.json): update date-fns dependency to version ^2.30.0
  • Loading branch information
jofftiquez authored Aug 16, 2023
2 parents f4e6ef0 + 4b01b74 commit fb6bb03
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 15 deletions.
16 changes: 8 additions & 8 deletions DOC.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
<p>{{ new Date() | morph-date-format('MMM DD, YYYY') }}</p>
<p>{{ new Date() | morph-date-format('MMM dd, yyyy') }}</p>
<!-- Jul 26, 2017 -->

<p>{{ new Date() | morph-date-format('YYYY') }}</p>
<p>{{ new Date() | morph-date-format('yyyy') }}</p>
<!-- 2017 -->

<p>{{ new Date() | morph-date-format('[Today is a] dddd') }}</p>
<p>{{ new Date() | morph-date-format('[Today is a] EEEE') }}</p>
<!-- Today is Wednesday -->
```

```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');

console.log(formatted); // Mar 20, 1976
console.log(year); // 1976
Expand All @@ -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)

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion src/filters/age/age.test.js
Original file line number Diff line number Diff line change
@@ -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();
Expand Down
2 changes: 1 addition & 1 deletion src/filters/date/date-format.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
22 changes: 18 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -2567,10 +2574,12 @@ data-urls@^1.0.0:
whatwg-mimetype "^2.2.0"
whatwg-url "^7.0.0"

[email protected]:
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"
Expand Down Expand Up @@ -5978,6 +5987,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"
Expand Down

0 comments on commit fb6bb03

Please sign in to comment.