Show/Hide Based on Date/Time [Snippet] <> No-Code Supply Co.
Show/Hide Based on Date/Time
// ".before" is class to show before time, and ".after" is class to show after
window.setInterval(function() {
let current = new Date();
let expiry = new Date("Mar 29, 2020 20:21:00")
if (current.getTime() > expiry.getTime()) {
$('.before').hide();
$('.after').show();
} else if (current.getTime() < expiry.getTime()) {
$('.before').show();
$('.after').hide();
}
}, 0);

Hide, show or do something else with an element based on a specific date and time.

Creators

Have feedback or a question related to this item? Drop us some feedback!

Curated: 
3.27.20

Similar items

Danis Pekić

10.8.24

HF-11

10.8.24

Frameship

10.8.24

Cap

10.8.24

Hartmann Capital

10.8.24

Blocs Framer Plugin

10.3.24

Irene Butenko

10.3.24

Jack Elder

10.3.24

Displace Figma Plugin

10.1.24

Codefortify

10.1.24

AKARI

10.1.24

Spot Insurance

9.30.24

Ivan Duzhak

9.30.24

DivBlockers

9.30.24

TaxGPT

9.30.24

Departure Mono

9.30.24

Polypane

9.30.24

BRANDIV

9.27.24

Modern Tax

9.27.24

Dither Figma Plugin

9.27.24

Toolkit by Flow Guys

9.27.24

Tobias van Schneider

9.27.24

Video Frame Extractor

9.26.24

Jordan Butcher

9.24.24

Panels

9.24.24

Squarespace Refresh 2024

9.24.24
Load more

Bummer, no results

Try a different search/filter combo, or drop us some feedback if there is something missing you would love to see!

Reset filters

Subscribe for updates

Get updates on the latest curated resources and be the first to hear of new features.