Page 1 of 1

Dategadget and birthdays < 1970

Posted: Tue Sep 10, 2024 1:23 pm
by Dirk Geppert
Hi guys,

I would like to request the date of birth in a registration form. Unfortunately, entries older than 1 January 1970 are not permitted, which seems a bit strange to me in connection with modern web technology.

Is there a workaround?

Code: Select all

  If OpenWindow(0, 0, 0, 200, 250, "DateGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
    DateGadget(0, 10, 10, 180, 25, "%mm/%dd/%yyyy")
    SetGadgetState(0, Date(1970, 1, 1, 1, 1, 1))
  EndIf

Re: Dategadget and birthdays < 1970

Posted: Tue Sep 10, 2024 1:57 pm
by Quin
The DateGadget depends on the Date library, so I don't think there are any workarounds until that gets updated.
There was a topic opened a little while ago asking to extend the date library: viewtopic.php?t=2629
As I said there, PureBasic recently saw this change, hopefully SB will come soon!

Re: Dategadget and birthdays < 1970

Posted: Tue Sep 10, 2024 2:31 pm
by Peter
Quin wrote: Tue Sep 10, 2024 1:57 pmThe DateGadget depends on the Date library, so I don't think there are any workarounds until that gets updated.
The SpiderBasic Date library is based on the JavaScript library xdate (https://arshaw.com/xdate/). This library is able to work with date values before 1970. PureBasic has also been able to process values from 1601 to 9999 for some time.

If you look at the SpiderBasic JavaScript code, you can see that limitations have been built in at key points so that no values before 1970 are processed.

It would be a good idea to remove the limitation (especially since PureBasic can do it now and both programming languages are compatible again).

Re: Dategadget and birthdays < 1970

Posted: Tue Sep 10, 2024 3:31 pm
by Fred
Makes sense, I will take a closer look.