Closed ardunster closed 3 years ago
I'll close this pr, and will update the correct usage later.
Besides, you can refer to this https://day.js.org/docs/en/installation/typescript#locale-and-plugin-import
It would be great if that information was also included in the plugin section, I had already successfully installed and used dayjs all over my project in typescript and it did not occur to me that the plugin instructions would be in the typescript installation section.
Also, your response makes it sound like the notes I added are not the correct usage. If that's so, how is it incorrect? It looks the same as the information you linked and it works.
Check this https://day.js.org/docs/en/installation/typescript#have-trouble-importing-dayjs
might relate to yur ts config
I couldn't find anywhere in the documentation that actually gave me the correct syntax to import and use these plugins in my Typescript project (
import 'dayjs/plugin/utc'
didn't result in a variable to feed to.extend
, and when I triedimport { utc } from 'dayjs/plugin/utc'
it couldn't find an object to import), so I tried this and it seems to work fine, suggest adding for users who are not using therequire
syntax.