I have created a HTML5 app and I'd like to add a message box or image that displays a message but automatically updates each week at midnight, the text will only say "service week (number)" is there any way I can do this?
I have created a HTML5 app and I'd like to add a message box or image that displays a message but automatically updates each week at midnight, the text will only say "service week (number)" is there any way I can do this?
You probably can.. but you would need to write some custom JavaScript to implement this feature.
Any idea how to do this any tutorials to follow I've never wrote any code
Hi Sam,
http://docs.appery.io/tutorials/ you can try our tutorials here
Sorry, we don't have a tutorial for that.. this is custom app logic. You need to have good experience with JavaScript to add such feature.
Hi Sam,
The following function is a part of jQuery.Datepicker component code:
precodeiso8601Week: function(date) {
date = date || new Date();
var time,
checkDate = new Date(date.getTime());
Code: Select all
// Find Thursday of this week starting on Monday
checkDate.setDate(checkDate.getDate() + 4 - (checkDate.getDay() || 7));
time = checkDate.getTime();
checkDate.setMonth(0); // Compare with Jan 1
checkDate.setDate(1);
return Math.floor(Math.round((time - checkDate) / 86400000) / 7) + 1; }/code/pre
Add this code as JavaScript asset and call it when you need to get number of current week. You can also pass needed date to find out what week it is.
Thank you for your help ill try it out later ![]()