Dategadget and birthdays < 1970

Just starting out? Need help? Post your questions and find answers here.
Dirk Geppert
Posts: 332
Joined: Fri Sep 22, 2017 7:02 am

Dategadget and birthdays < 1970

Post 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
Quin
Posts: 118
Joined: Wed Nov 08, 2023 4:38 pm

Re: Dategadget and birthdays < 1970

Post 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!
User avatar
Peter
Posts: 1197
Joined: Mon Feb 24, 2014 10:17 pm
Location: 127.0.0.1:9080
Contact:

Re: Dategadget and birthdays < 1970

Post 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).
Fred
Site Admin
Posts: 1820
Joined: Mon Feb 24, 2014 10:51 am

Re: Dategadget and birthdays < 1970

Post by Fred »

Makes sense, I will take a closer look.
Post Reply