New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
minTime is not work #377
Comments
I think the issue is with the new DateFormatter - I see the same issue. The issue seems to be around
the new parseDate called from strtotime is responding with:
while it's being compared to:
but this will never happen. Changing:
to:
resolves my issue but I'm sure there are other cases that I didn't consider, like seconds, milliseconds .. |
snagytx, thank you sir! |
I resolved this issue with changing this section of code if ((options.minDateTime !== false && options.minDateTime > optionDateTime) || (options.maxTime !== false && _xdsoft_datetime.strtotime(options.maxTime).getTime() < now.getTime()) || (options.minTime !== false && _xdsoft_datetime.strtotime(options.minTime).getTime() > now.getTime())) {
classes.push('xdsoft_disabled');
} to this var nowMonth = now.getMonth()+1;
if(nowMonth<10){ nowMonth = "0"+nowMonth;}
var minT = nowMonth+"/"+now.getDate()+"/"+now.getFullYear()+" "+options.minTime;
var maxT = nowMonth+"/"+now.getDate()+"/"+now.getFullYear()+" "+options.maxTime;
if ((options.minDateTime !== false && options.minDateTime > optionDateTime) || (options.maxTime !== false && _xdsoft_datetime.strtotime(new Date(maxT)).getTime() < now.getTime()) || (options.minTime !== false && _xdsoft_datetime.strtotime(new Date(minT)).getTime() > now.getTime())) {
classes.push('xdsoft_disabled');
} Similar to the solution provided by @snagytx, but done in a different location and forcing the date and adding the minTime/maxTime values to the string. The one thing that there might be issues with is when you have different min/max times on different days. However, in my case, if all of your enabled dates have the same time range then it should be fine. Also, you may notice I converted the string into a new date inside the if statement, mainly so I can just output the string to the console for testing before getting into the if. You could move the |
I tried doing this but dint seam to work for me , Please help . THanks |
when i set options minTime "20:00", but is not work
The text was updated successfully, but these errors were encountered: