[HTML & JS] Incomming event(s) in html
You can make a list of special dates (probably a 2D array, with a date and special message. e.g. save January first (of every year) and a special message/string that says "happy new year!" for example) and check the current date against this array.
If you just want something quick and dirty, this will work. But the disadvantages are plenty:
- This will be calculated every time the user loads the webpage
- If they have the wrong date setup, it will do weird stuff
You might want to calculate that sort of stuff server-side, once a day for example (although you might want to sync that up to the user's timezone).
This should get you somewhat started on the simple implementation:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date

Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now