Currently browsing JavaScript Time & Date

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…

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…

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.…

How to Expire localStorage Items and Replace Cookies

I don’t use ๐Ÿช cookies any more, I think they are tooโ€ฆ rigid. I use localStorage items. By default, they…

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.

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,…