Need help of using a specific day of the week as a notification text in the help display of date variable.
Example, a survey is conducted every day and at the end of the week (example: Friday), some variables are needed to be filled up by the participant for the weekly updating while not required in other days of the week.
So is there a solution of notifying the participant through a help text of a date (Thursday) that tomorrow is Friday and a weekly report is due while he is updating the record on a Thursday?
Hi,
as you know, there is no function "dayofweek" or so in LS.
So I used a bit javascript.
There is the function Date.getDay() to get the dayofweek out of a date.
www.w3schools.com/jsref/jsref_getday.asp
Code:
<script type="text/javascript" charset="utf-8">
$(document).on('ready pjax:scriptcomplete',function(){
var d = new Date();
var dow=d.getDay();
if (dow==4) {
$(".myHelp").text("Tomorrow is Friday");
} else {
$(".myHelp").text("");
}
});
</script>
and the helptext I set to:
<span class="myHelp">xxx</span>
The styling of this message is up to you.
Joffm
Volunteers are not paid.
Not because they are worthless, but because they are priceless