Currently browsing JavaScript Time & Date

Thursday, January 26, 2023

How to create time constants in JavaScript in a performant way

A recent project of mine required time constants, and instead of opting for an additional library for just 10 or…

Monday, May 16, 2022

Vanilla JavaScript table date sorting

Say we have a table with dates, in the following format: We want to sort this table dynamically based on…

Monday, May 16, 2022

How to add a top bar countdown for your next product sale

You can (probably) see this top bar right now, with a nice 30% off sale for my WordPress Lighthouse plugin.…

Monday, May 16, 2022

๐Ÿช How to Expire localStorage Items and Replace Cookies

I don’t use ๐Ÿช cookies anymore, I think they are too… rigid. I use localStorage items. By default, they don’t…

Wednesday, January 18, 2023

24-Hour Countdown with Progress Saving Using Vanilla JavaScript

Hereโ€™s an interesting JavaScript snippet allowing you to set a 24-hour countdown and save its progress between page loads.

Monday, May 16, 2022

Date Countdown Using Vanilla JavaScript

A while ago, I coded several date countdowns for several promotions. These countdowns went straight inside a third-party popup solution,…