KubeJS-Mods / KubeJS

https://kubejs.com
GNU Lesser General Public License v3.0
297 stars 87 forks source link

"1d" gets converted to 24 days instead of 1 day #842

Closed andriihorpenko closed 1 month ago

andriihorpenko commented 1 month ago

Minecraft Version

1.19.2

KubeJS Version

1902.6.2-build.69

Rhino Version

1902.2.3-build.284

Architectury Version

6.6.92

Forge/Fabric Version

Forge 43.3.7

Describe your issue

For some reason, 86400 seconds (which is 1 day) is multiplied by 24, making it 24 days instead of 1. Same goes with weeks ('1w' is also calculated incorrectly).

https://github.com/KubeJS-Mods/KubeJS/blob/7219f93290ef147ca89ea41468cb58084f6e2634/src/main/java/dev/latvian/mods/kubejs/util/UtilsJS.java#L932C6-L932C66 image

Crash report/logs

No response