Starting with v2.0.0-beta.1 date-fns doesn't accept strings as arguments. Please use `parseISO` to parse strings

See original GitHub issue

So, 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:closed
  • Created 5 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
TrySoundcommented, Feb 4, 2019

@TheoMer

import { parseISO, format } from 'date-fns';
2reactions
TrySoundcommented, Feb 4, 2019

yarn add date-fns@next or npm i date-fns@next

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found