Posted: Wed Jan 08, 2003 11:51 pm
Restored from previous forum. Originally posted by Fangbeast.
Could someone check for me that my Date comparison is the right way to do it and it works? I think I got it right but not 100% sure that it compares correctly
;- Check to see if the current book is overdue or not
checkoverdue:
today = Date() ; Get the current system date
duedate = ParseDate("%dd/%mm/%yyyy", GetGadgetText(#Gadget_updatebox_duedatebox))
returned = ParseDate("%dd/%mm/%yyyy", GetGadgetText(#Gadget_updatebox_returnedonbox))
borrowed = ParseDate("%dd/%mm/%yyyy", GetGadgetText(#Gadget_updatebox_borrowedonbox))
If today > duedate And returned = 0 ; greater than
SetGadgetText(#Gadget_updatebox_bookstatusbox, "Overdue!")
ElseIf today > duedate And returned > duedate
SetGadgetText(#Gadget_updatebox_bookstatusbox, "Fine!")
ElseIf returned < duedate
SetGadgetText(#Gadget_updatebox_bookstatusbox, "Okay")
EndIf
Return
Fangles woz ear orright den?
Could someone check for me that my Date comparison is the right way to do it and it works? I think I got it right but not 100% sure that it compares correctly
;- Check to see if the current book is overdue or not
checkoverdue:
today = Date() ; Get the current system date
duedate = ParseDate("%dd/%mm/%yyyy", GetGadgetText(#Gadget_updatebox_duedatebox))
returned = ParseDate("%dd/%mm/%yyyy", GetGadgetText(#Gadget_updatebox_returnedonbox))
borrowed = ParseDate("%dd/%mm/%yyyy", GetGadgetText(#Gadget_updatebox_borrowedonbox))
If today > duedate And returned = 0 ; greater than
SetGadgetText(#Gadget_updatebox_bookstatusbox, "Overdue!")
ElseIf today > duedate And returned > duedate
SetGadgetText(#Gadget_updatebox_bookstatusbox, "Fine!")
ElseIf returned < duedate
SetGadgetText(#Gadget_updatebox_bookstatusbox, "Okay")
EndIf
Return
Fangles woz ear orright den?