#PB_Date_Maximum not working on DateGadget

Just starting out? Need help? Post your questions and find answers here.
tatanas
Enthusiast
Enthusiast
Posts: 204
Joined: Wed Nov 06, 2019 10:28 am
Location: France

#PB_Date_Maximum not working on DateGadget

Post by tatanas »

Hi,

I just notice a problem with #PB_Date_Maximum and DateGadget.
If you try to set the max year range > 2037, the blocking is not working anymore.

Code: Select all

If OpenWindow(0, 0, 0, 235, 250, "DateGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
	DateGadget(0, 10, 10, 210, 25, "%mm/%yyyy", 0, #PB_Date_UpDown)
	SetGadgetAttribute(0, #PB_Date_Minimum, Date(2010, 1, 1, 0, 0, 0))
; 	SetGadgetAttribute(0, #PB_Date_Maximum, Date(2037, 12, 31, 0, 0, 0)) ; ok
	SetGadgetAttribute(0, #PB_Date_Maximum, Date(2038, 12, 31, 0, 0, 0)) ; not ok
	Repeat
		If EventGadget() = 0
			If EventType() = #PB_EventType_Change
				Debug GetGadgetText(0)
			EndIf
		EndIf
	Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf
PB 5.73 x64

// Moved from "Bugs - Windows" to "Coding Questions" (Kiffi)
Windows 10 Pro x64
PureBasic 6.04 x64
User avatar
Kiffi
Addict
Addict
Posts: 1357
Joined: Tue Mar 02, 2004 1:20 pm
Location: Amphibios 9

Re: #PB_Date_Maximum not working on DateGadget

Post by Kiffi »

Not a bug:
PB-Help wrote:Note: supported date/time values are 1970-01-01, 00:00:00 for the minimum and 2038-01-19, 03:14:07 for the maximum. See also https://en.wikipedia.org/wiki/Year_2038_problem.
Hygge
tatanas
Enthusiast
Enthusiast
Posts: 204
Joined: Wed Nov 06, 2019 10:28 am
Location: France

Re: #PB_Date_Maximum not working on DateGadget

Post by tatanas »

Oh I see. I was not aware of this problem. It's funny :)
Windows 10 Pro x64
PureBasic 6.04 x64
User avatar
blueb
Addict
Addict
Posts: 1044
Joined: Sat Apr 26, 2003 2:15 pm
Location: Cuernavaca, Mexico

Re: #PB_Date_Maximum not working on DateGadget

Post by blueb »

tatanas wrote:Oh I see. I was not aware of this problem. It's funny :)
Hi tatanas,

Kurzer and Wilbert solved your problem.. viewtopic.php?p=478507#p478507

:wink:
- It was too lonely at the top.

System : PB 6.10 LTS (x64) and Win Pro 11 (x64)
Hardware: AMD Ryzen 9 5900X w/64 gigs Ram, AMD RX 6950 XT Graphics w/16gigs Mem
Post Reply