Skip to content

Commit 70845c1

Browse files
committed
πŸ“ docs(DOC.md): update date-fns version and fix date format examples
πŸ“š chore(DOC.md): update link to date-fns format documentation The `morph-date-format` function in the DOC.md file has been updated to use `[email protected]` instead of `[email protected]`. This update ensures compatibility with the latest version of `date-fns` and provides access to the latest features
1 parent f02d16a commit 70845c1

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

β€ŽDOC.mdβ€Ž

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -230,25 +230,25 @@ Format any valid date using date-fns' `format()` function.
230230

231231
`morph-date-format(format)`
232232

233-
*Note* - `morph-date-format` is now using using [`date-fns@v1.30.1`](https://date-fns.org/).
233+
*Note* - `morph-date-format` is now using using [`date-fns@v2.30.0`](https://date-fns.org/).
234234

235235
```html
236-
<p>{{ new Date() | morph-date-format('MMM DD, YYYY') }}</p>
236+
<p>{{ new Date() | morph-date-format('MMM dd, yyyy') }}</p>
237237
<!-- Jul 26, 2017 -->
238238

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

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

246246
```javascript
247247
const date = new Date('1976-03-20');
248248

249-
const formatted = this.$morphDateFormat(date, 'MMM DD, YYYY');
250-
const year = this.$morphDateFormat(date, 'YYYY');
251-
const time = this.$morphDateFormat(new Date(), 'hh:mm A');
249+
const formatted = this.$morphDateFormat(date, 'MMM dd, yyyy');
250+
const year = this.$morphDateFormat(date, 'yyyy');
251+
const time = this.$morphDateFormat(new Date(), 'hh:mm a..aa');
252252

253253
console.log(formatted); // Mar 20, 1976
254254
console.log(year); // 1976
@@ -257,7 +257,7 @@ console.log(time); // 11:00 PM
257257

258258
**API**
259259

260-
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.
260+
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.
261261

262262
[Back to top](#filters)
263263

0 commit comments

Comments
Β (0)