Home   Archive   Permalink



'Days Between' script....is a beauty....wondering

....I notice that when the start date is say 1-APR-2014 and I try a few end dates in April it works fine...if I select month June (or whatever) and slect say 28 for the day...the calculation comes out as 27 days. It's good that the displayed end date IS 28-APR-2014...even though I have JUNE showing in the date select window as I just selected June 28th....but one seems to have to cycle the select date display back and forth some to get the change of month to be recognized by the main code. This may be a date selct module issue though.........

posted by:   John Dutcher     28-Apr-2014/15:00:41-7:00



Yes, there is currently a bug in the 'request-date function. When used multiple times in the same app, it displays the most recently selected month name, even when potentially displaying different month days. If you scroll forward or back a month (using the little triangle controls), you'll see it re-adjust correctly. The selected date value will contain the correct month, (even if the header is displayed incorrectly).
    
You can use the updated function in the script below. The 'request-date function here also contains some other improvements:
    
http://www.rebol.org/view-script.r?script=request-date.r&sid=v252lr
    
I often use RebGUI for production GUI dialogues. Its date requestor is also nicer than the built in VID requestor.
    
For quick utility scripts I'll use the native date requestor for its fast convenience, and I just scroll one month either direction to be sure the correct month title is being displayed.    
    
For production work, use one of the options above.

posted by:   Nick     28-Apr-2014/22:01:28-7:00