Notes
![]() ![]() Notes - notes.io |
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
<script>
function getIso8601WeekOfYear(time) {
// Your week calculation logic here
}
function generateManyDaysDates(startDate, endDate) {
// Your date generation logic here
}
function processData() {
var sendData = {
Regular0hrs: [],
Regular1hrs: [],
Regular2hrs: [],
Regular3hrs: [],
Regular4hrs: [],
Regular5hrs: [],
Regular6hrs: []
};
var startDate = new Date(2023, 10, 27); // Months are 0-indexed
var endDate = new Date(2023, 11, 24);
var manyAllowedDays = [0, 1, 2, 3, 4, 5, 6];
var previousWeekNo = 0;
var previousMonth = 0;
var previouslyActive = "";
var testcases = generateManyDaysDates(startDate, endDate);
$.each(testcases, function(index, date) {
var weekNumber = getIso8601WeekOfYear(date);
if (previousWeekNo === weekNumber && previousMonth === date.getMonth()) {
// previouslyActive = "Regular1hrs";
} else {
previousWeekNo = weekNumber;
switch (previouslyActive) {
case "Regular0hrs":
previouslyActive = "Regular1hrs";
break;
case "Regular1hrs":
previouslyActive = "Regular2hrs";
break;
case "Regular2hrs":
previouslyActive = "Regular3hrs";
break;
case "Regular3hrs":
previouslyActive = "Regular4hrs";
break;
case "Regular4hrs":
previouslyActive = "Regular5hrs";
break;
case "Regular5hrs":
previouslyActive = "Regular6hrs";
break;
default:
previouslyActive = "Regular0hrs";
break;
}
}
switch (previouslyActive) {
case "Regular0hrs":
sendData.Regular0hrs.push(date);
break;
case "Regular1hrs":
sendData.Regular1hrs.push(date);
break;
case "Regular2hrs":
sendData.Regular2hrs.push(date);
break;
case "Regular3hrs":
sendData.Regular3hrs.push(date);
break;
case "Regular4hrs":
sendData.Regular4hrs.push(date);
break;
case "Regular5hrs":
sendData.Regular5hrs.push(date);
break;
case "Regular6hrs":
sendData.Regular6hrs.push(date);
break;
default:
break;
}
previousMonth = date.getMonth();
});
console.log(sendData);
// You can use sendData as needed.
}
// Call your processData function when the document is ready or when needed
$(document).ready(function() {
processData();
});
</script>
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team