datmeal / tooki.gg-lostarkchecklist

tooki.gg is a Lost Ark web application that includes a checklist, event timers, and calculators.
https://tooki.gg
9 stars 3 forks source link

Remove momentjs #16

Closed Clodolt closed 2 years ago

Clodolt commented 2 years ago

Note: Two instances are left as the instances of moment.js are left as they seem redundant but break the code if changed at all

Instance 1: let eventTime = moment(time, "HH:mm") // .subtract(offsetSeconds, "seconds") .format("HH:mm");

Instance 2: const eventTime = moment(timeText, "HH:mm").format("HH:mm");

datmeal commented 2 years ago

@Clodolt Hey, thanks for helping out with the code! There are several weird gotchas that I've had to deal with when making this Event Page, and one of them seems to be popping back up with this PR:

When the time is about to roll over to a new day (right before 00:00) it is supposed to show events that will happen all the way up to about 05:00 the next day, so events that happen at 00:00, 01:00, should be visible before the actual day begins. With this PR, it seems that at 23:59, it no longer shows events that will happen the next day until the clock reaches 00:00.

This is how it should look: tookiGotcha

I was previously able to test this using the code under //Test Time in the refreshClock() function, if that helps!

Clodolt commented 2 years ago

Hello Salty,

this should be adressed now, overlooked the fact that event.times returns a string.

Let me know if you find any other bugs/edge cases :)

datmeal commented 2 years ago

Hey @Clodolt , It still doesn't seem to be showing events after 24:00 nextdayEvents Also, can we get back the humanized time text under the events? So instead of "3 hour 23 minutes and 51 seconds" it says "4 hours" etc

Clodolt commented 2 years ago

Hello @datmeal,

Sorry for the late reply, it's been a busy week.

I've tested it on Chrome 100.0.4896, FireFox 99.0 and Safari 15.3 now and it seems to be working (see screenshot below)

image

Did you fetch my branch properly?

Also, removed the seconds at your request :)

datmeal commented 2 years ago

Okay, I confirmed again and it seems to be working, so yea maybe I messed up the branch? I'm gonna change how the time is described but this branch is OK so I will merge :) thanks for your help! Now that new content is gonna be released.....time for more work.......