Skip to content

Instantly share code, notes, and snippets.

@csakiistvan
Created May 22, 2019 14:48
Show Gist options
  • Save csakiistvan/66dc12702e9d31339764fb16ba90c7dc to your computer and use it in GitHub Desktop.
Save csakiistvan/66dc12702e9d31339764fb16ba90c7dc to your computer and use it in GitHub Desktop.
Check the weekend and change the text in js
$(document).ready(function(){
var date = new Date()
var is_weekend = ''
if(date.getDay() == 1) {
is_weekend = "Today is closed";
} else if (date.getDay() == 2 || date.getDay() == 5) {
is_weekend = "Ma nyitva 16:00-ig";
} else {
is_weekend = "Ma nyitva 18:00-ig";
}
document.getElementById("open-text").innerHTML = is_weekend;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment