You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
new Date().toString() -> Fri Feb 28 2020 17:58:05 GMT+0100 (czas środkowoeuropejski standardowy)
new Date().toLocaleString() -> 28.02.2020, 17:58:05
new Date().getTimezoneOffset() ->
-60
navigator.userAgent -> Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.122 Safari/537.36
moment.version -> 2.24.0
The text was updated successfully, but these errors were encountered:
@rafalgiemza Errors not only occur in leap years, they also have problems in non leap years.
Source Code
There will always be a certain deviation when the number of months and days are converted from each other. Maybe we should return the specific number of days according to the specific month.
Do you have any ideas : )? thanks.
// bubble.jsexportfunctiondaysToMonths(days){// 400 years have 146097 days (taking into account leap year rules)// 400 years have 12 months === 4800returndays*4800/146097;}exportfunctionmonthsToDays(months){// the reverse of daysToMonthsreturnmonths*146097/4800;}
Describe the bug
Bug occurs in leap year
To Reproduce
Steps to reproduce the behavior:
Expected behavior
Should be 31 days ago
Screenshots
Please run the following code in your environment and include the output:
console.log output:
The text was updated successfully, but these errors were encountered: