Starting with v2.0.0-beta.1 date-fns doesn't accept strings as arguments. Please use `parseISO` to parse strings
See original GitHub issueSo, until I deployed today I was using version ^2.0.0-alpha.7 with no issues, but then got the following error:
Starting with v2.0.0-beta.1 date-fns doesn't accept strings as arguments. Please use `parseISO` to parse strings
I upgraded to the latest version and am now getting an parseISO is not defined error. My code is as follows:
import { format } from 'date-fns';
<span>{format(parseISO(order.createdAt), 'MMMM d, YYYY h:mm a', { awareOfUnicodeTokens: true })}</span>
What am I overlooking here?
Issue Analytics
- State:
- Created 5 years ago
- Comments:10 (5 by maintainers)
Top Results From Across the Web
date-fns doesn't accept strings as date arguments. Please use ...
If for some reason you need to stick to your original string format, I suggest you use the parse function of date-fns like...
Read more >date-fns
From now on functions will accept only dates and numbers as arguments. Strings should be parsed beforehand. This change enabled us to bring ......
Read more >client/node_modules/date-fns/CHANGELOG.md - GitLab
BREAKING: toDate (previously parse ) now doesn't accept string arguments but only numbers and dates. toDate called with an invalid argument will return...
Read more >date-fns.parseISO JavaScript and Node.js code examples
public static formatDateDistance(time: any): string { return fs.formatDistance(fs.subDays(fs.parseISO(time) ... How to use. parseISO. function. in. date-fns ...
Read more >Overlapping segments of 'kentcdodds.com/build/_ ... - Bundle Scanner
/esm/_lib/requiredArgs/index.js from date-fns@2.24.0 ... date-fns doesn't accept strings as date arguments. Please use `parseISO` to parse strings.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@TheoMer
yarn add date-fns@nextornpm i date-fns@next