M
M
modest2015-12-24 16:31:26
JavaScript
modest, 2015-12-24 16:31:26

How to organize an action at night?

I need to do a night action in the online store.
I see it as a banner appearing on the promotion page or a pop-up window with a promo code at a certain time of the day.
How can it be implemented? Preferably without getting into php.
Online chats somehow cope with similar functionality, but for other purposes.
Maybe some external javascript service?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Askhat Bikmetov, 2015-12-24
@ modest

var time = new Date();
if (time.getHours() === 23) {
  // do something
}

A
Anton, 2015-12-24
@hummingbird

Well, you catch time, you prescribe a condition, and in its body a call to a modal window (for example). What is the problem?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question