Page 1 of 1
nuDate Problems - Urgent
Posted: Thu Jun 06, 2024 2:32 pm
by vario
I've just updated to the latest release and find that date fields with a non-default format (i.e not yyyy-mm-dd) aren't working. The date picker comes up but the date is not displayed in the field after selection - I am using dd-mmm-yyyy for these fields. I also find that when the field receives focus the existing value, say '01-Sep-2024' becomes '01-September-2024' - very strange.
Modified dates are set to null in the database - have I had a failure during upgrade?
DB Version V4.5-2024.05.31.00
Files Version V4.5-2024.06.03.00
Neil.
Re: nuDate Problems - Urgent
Posted: Thu Jun 06, 2024 2:44 pm
by kev1n
If possible, consider temporarily changing the format to yyyy-mm-dd until a fix is in place.
Re: nuDate Problems - Urgent
Posted: Thu Jun 06, 2024 2:59 pm
by kev1n
I think the issue lies within the nuConvertToVanillaJSCalendarFormat() function in nuform.js:. Please try replacing it with the following updated version
Code: Select all
function nuConvertToVanillaJSCalendarFormat(str) {
const formatMapping = {
'D|': '',
'ddd': 'DD',
'mmm': 'M'
};
let newStr = str.replace(/D\||ddd|mmm/g, match => formatMapping[match]);
return newStr;
}
Re: nuDate Problems - Urgent
Posted: Thu Jun 06, 2024 3:13 pm
by vario
I've had to revert to the backup DB 2024.05.07.00 & Files 2024.05.11.00 so will need to set up a test environment before risking another upgrade! Too many date fields to change them all.
Will get back to you when I've set up a copy (busy at the moment).
Re: nuDate Problems - Urgent
Posted: Thu Jun 06, 2024 3:17 pm
by vario
The code you've given above appears to be the same as I already have in the new version (downloaded this morning UK time)?
Re: nuDate Problems - Urgent
Posted: Thu Jun 06, 2024 3:27 pm
by kev1n
No it's not identical, see on
Github
Re: nuDate Problems - Urgent
Posted: Thu Jun 06, 2024 3:28 pm
by kev1n
vario wrote: ↑Thu Jun 06, 2024 3:13 pm
Too many date fields to change them all.
A simple SQL query could have achieved the same result effortlessly
Re: nuDate Problems - Urgent
Posted: Thu Jun 06, 2024 3:37 pm
by kev1n
vs.
PS: Use e.g .
https://www.diffchecker.com to compare codes
Re: nuDate Problems - Urgent
Posted: Thu Jun 06, 2024 3:49 pm
by vario
OK, I didn't think to change formats via the SQL prompt, but don't want to do that anyway in case some other issue arises as a consequence (most likely in my code).
I'm ashamed I couldn't see the difference in a 3-line function...