We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ios时间转时间戳出现invalid Date moment在ios时间转时间戳出现invalid Date
1.IOS上getTime(),getFullYear()等方法返回NaN 2.moment处理类似 2020/1/1的格式会invalid Date
1
new Date("2018-02-15 20:30:00".replace(/-/g,'/')).getTime(); new Date("2018-02-15 20:30:00".replace(/-/g,'/')).getFullYear();
2
//moment使用2020/02/01的正规格式进行处理 moment('2018-02-15') // ios不支持 moment('2018/02/15') // 需要转成此形式
ios时间兼容性问题,ios只兼容斜杠格式的时间(2020/09/29),需要用replace(/-/g, "/")将时间转化为ios兼容的格式。
主要是日常业务代码问题整理。
后续会一直更新,希望各位看官不要吝啬手中的赞。
❤️ 感谢各位的支持!!!
❤️ 如果有错误或者不严谨的地方,请务必给予指正,十分感谢!!!
❤️ 喜欢或者有所启发,欢迎 star!!!
The text was updated successfully, but these errors were encountered:
No branches or pull requests
一、概述
1.IOS上getTime(),getFullYear()等方法返回NaN
2.moment处理类似 2020/1/1的格式会invalid Date
二、解决
1
2
ios时间兼容性问题,ios只兼容斜杠格式的时间(2020/09/29),需要用replace(/-/g, "/")将时间转化为ios兼容的格式。
兼容性系列
主要是日常业务代码问题整理。
后续会一直更新,希望各位看官不要吝啬手中的赞。
❤️ 感谢各位的支持!!!
❤️ 如果有错误或者不严谨的地方,请务必给予指正,十分感谢!!!
❤️ 喜欢或者有所启发,欢迎 star!!!
The text was updated successfully, but these errors were encountered: