Automatic day information / calendar note

I manage a web site for a museum railway. We would like to put a headline on our first page:
Today we are open
or
Today we are closed
based on a calendar we have. Or on a list of open dates?
Any advice much appreciated!
Anders

var now = new Date();
var nowIso = now.toISOString().split('T')[0]; //will result in year-month-day ... 2017-01-29

so if you’ve got an array
var _closed = ['2017-04-05', 'next date']

you can check
if(_closed.indexOf(nowIso) != -1)alert('today closed')

3 Likes