Welcome to the nuBuilder Forums!

Register and log in to access exclusive forums and content available only to registered users.

nuDate Problems - Urgent Topic is solved

Questions related to installing, updating, setting up and configuring
Post Reply
vario
Posts: 148
Joined: Mon Dec 05, 2011 12:23 pm
Location: Newton Abbot, UK
Has thanked: 1 time
Been thanked: 1 time

nuDate Problems - Urgent

Unread post 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.
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: nuDate Problems - Urgent

Unread post by kev1n »

If possible, consider temporarily changing the format to yyyy-mm-dd until a fix is in place.
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: nuDate Problems - Urgent

Unread post 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;
}
vario
Posts: 148
Joined: Mon Dec 05, 2011 12:23 pm
Location: Newton Abbot, UK
Has thanked: 1 time
Been thanked: 1 time

Re: nuDate Problems - Urgent

Unread post 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).
vario
Posts: 148
Joined: Mon Dec 05, 2011 12:23 pm
Location: Newton Abbot, UK
Has thanked: 1 time
Been thanked: 1 time

Re: nuDate Problems - Urgent

Unread post 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)?
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: nuDate Problems - Urgent

Unread post by kev1n »

No it's not identical, see on Github
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: nuDate Problems - Urgent

Unread post 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
kev1n
nuBuilder Team
Posts: 4292
Joined: Sun Oct 14, 2018 6:43 pm
Has thanked: 71 times
Been thanked: 444 times
Contact:

Re: nuDate Problems - Urgent

Unread post by kev1n »

Code: Select all

'mmm': 'MM'
vs.

Code: Select all

'mmm': 'M'

PS: Use e.g .https://www.diffchecker.com to compare codes
vario
Posts: 148
Joined: Mon Dec 05, 2011 12:23 pm
Location: Newton Abbot, UK
Has thanked: 1 time
Been thanked: 1 time

Re: nuDate Problems - Urgent

Unread post 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...
Post Reply