nuDate dd.mm.yy Year-Failure

Questions related to customising nuBuilder Forte with Javascript or PHP.

nuDate dd.mm.yy Year-Failure

Unread postby getNo » Fri May 28, 2021 5:51 pm

I found the following Bug.

When only showing 2 Years digits, the popup Calendar shows the wrong century.

Workaround using YYYY.
Attachments
calendar2.png
calendar2.png (17.37 KiB) Viewed 70 times
calendar1.png
calendar1.png (18.69 KiB) Viewed 70 times
getNo
 
Posts: 19
Joined: Fri Feb 19, 2021 2:26 am

Re: nuDate dd.mm.yy Year-Failure

Unread postby kev1n » Fri May 28, 2021 6:27 pm

Adding

Code: Select all
if (d.y.length == 2) d.y = '20' + d.y;


after

Code: Select all
d.y    = v[i];


should fix it.

https://github.com/nuBuilder/nuBuilder- ... s.js#L1057

This will treat a two digit year as in the 20th century.

You will need to log in again after modifying that file.
Attachments
2digits.jpg
2digits.jpg (33.34 KiB) Viewed 67 times
kev1n
nuBuilder Team
 
Posts: 1763
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5

Re: nuDate dd.mm.yy Year-Failure

Unread postby kev1n » Sat Jun 12, 2021 4:17 pm

Hi,

Does it work for you?
kev1n
nuBuilder Team
 
Posts: 1763
Joined: Mon Oct 15, 2018 2:13 am
nuBuilder Version: 4.5


Return to Custom Code

Who is online

Users browsing this forum: No registered users and 7 guests