Hi all, I have been working on a custom date time picker for days and its driving me mad. I tried styling the bubble date/time input but experienced a lot of conflicts and issues, such as the time picker showing when the datepicker was expected and dates and times not recording correctly. I have now built a custom date time picker, which was fine until I started trying to use it across timezones, Ie, appointment scheduled in a different timezone to where user currently is. If anyone is good with javascript who could help me for 15 to 30 minutes it would be much appreciated. Thanks
This is the javascript i am using:
function getDaysInMonth(month, year) {
var date = new Date(year, month, 1);
var days = ;
var lastDay = new Date(year, month, 0).getDate();
for (i = date.getDay() - 1; i >= 0; i–) {
days.push(new Date(year, month - 1, lastDay - i));
}
while (date.getMonth() === month) {
days.push(new Date(date));
date.setDate(date.getDate() + 1);
}
var date3 = new Date(year, month + 1, 1);
for (i = days[days.length - 1].getDay(); i != 6; i++) {
days.push(new Date(date3));
date3.setDate(date3.getDate() + 1);
}
for (i = days.length; i != 42; i++) {
days.push(new Date(date3));
date3.setDate(date3.getDate() + 1);
}
return days;
}
getDaysInMonth(Current date/time +(months):Main Calendar’s monthOffset:extract month - 1, Current date/time +(months):Main Calendar’s monthOffset:extract year);
Why not use Zero code data/time picker , there are plugins try both, both are free