dayjs.locale() throws type error due to type update in v.1.8.30
See original GitHub issueDescribe the bug
The locale() function used to accept a string up until v1.8.30, which updated the types to use LocalePresetType (https://github.com/iamkun/dayjs/commit/73813ab5851c118450f5d8fc15cae71d49d800ae). This has broken our CI/CD pipelines, as our i18n implementation returns the locale code as a string.
Expected behavior Patch versions should not include type changes that are not backwards compatible with previous versions.
Information
- Day.js Version [1.8.30]
- OS: [Ubuntu 16.04]
- Browser [n/a]
suggestion
Add back string as a valid type either in the function declarations or in the LocalePresetType union.
We can work around this issue by casting the string to a LocalePresetType but we would prefer if we didn’t have to do this everywhere our i18n interacts with dayjs.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:11 (7 by maintainers)
Top Results From Across the Web
iamkun/dayjs (Raised $1,326.00) - Issuehunt
dayjs.locale() throws type error due to type update in v.1.8.30. Unfunded#964created byB1rch. $0.00. How we can format the duration in dayjs.
Read more >dayjs: Versions | Openbase
Full version history for dayjs including change logs. ... fix type error to add ordianl property in InstanceLocaleDataReturn and GlobalLocaleDataReturn ...
Read more >umi怎么配置autoprefixer - CSDN
csdn已为您找到关于umi怎么配置autoprefixer相关内容,包含umi怎么配置autoprefixer相关文档代码介绍、相关教程视频课程,以及相关umi怎么配置autoprefixer问答内容。
Read more >https://gitea.xndr.de/philipp/nixpkgs/commit/01c2b...
For example an option of type <literal>attrsOf str</literal> can be used for ... 1 then cfg.users else throw "GRUB version 1 does not...
Read more >dayjs - dayjs.locale ()에서 v.1.8.30의 유형 업데이트로 인해 유형 오류 ...
에 만든 2020년 07월 22일 · 11코멘트 · 출처: iamkun/dayjs. 버그 설명 locale () 함수는 v1.8.30까지 문자열을 수락하는 데 사용되었으며 LocalePresetType ...
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

🎉 This issue has been resolved in version 1.8.31 🎉
The release is available on:
Your semantic-release bot 📦🚀
This would be a good fix at this moment. https://github.com/iamkun/dayjs/pull/968