[Glass] How can I test this

James Foster smalltalk at jgfoster.net
Mon Feb 21 10:00:30 PST 2022


| currentDate endDate |
currentDate := Date newDay: 1 monthNumber: 2 year: 2022.
endDate := Date newDay: 1 monthNumber: 7 year: 2022.
currentDate > (endDate subtractMonths: 2).

> On Feb 21, 2022, at 9:54 AM, Roelof Wobben <rwobben at hotmail.com> wrote:
> 
> Thanks
> But that way  I cannot tell that they are in 2 months
> 
> Example 
> 
> current date : 21-2-2022
> End date : 21-03-2022 
> 
> Schoudld give True 
> 
> but 
> 
> current-date: 21-020-2022
> end date : 21-07-2022 
> 
> Schould give false 
> 
> Roelof
> 
> Van: James Foster <smalltalk at jgfoster.net>
> Verzonden: maandag 21 februari 2022 17:50
> Aan: Roelof Wobben <rwobben at hotmail.com>
> CC: GLASS Mailing List <glass at lists.gemtalksystems.com>
> Onderwerp: Re: [Glass] How can I test this
>  
> | date1 date2 |
> date1 := Date newDay: 1 monthNumber: 2 year: 2022.
> date2 := date1 addMonths: 2.
> Date today <= date2.
> 
>> On Feb 21, 2022, at 5:35 AM, Roelof Wobben via Glass <glass at lists.gemtalksystems.com <mailto:glass at lists.gemtalksystems.com>> wrote:
>> 
>> Hello, 
>> 
>> IM a beginner in smalltalk and try to make a app with seaside.
>> Now I wonder how I can do this 
>> 
>> I want to make a if then which checks if the current-date and a given end-date is not more then 2 months difference.
>> 
>> 
>> Thanks,
>> 
>> Roelof
>> 
>> _______________________________________________
>> Glass mailing list
>> Glass at lists.gemtalksystems.com <mailto:Glass at lists.gemtalksystems.com>
>> https://lists.gemtalksystems.com/mailman/listinfo/glass <https://lists.gemtalksystems.com/mailman/listinfo/glass>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gemtalksystems.com/mailman/archives/glass/attachments/20220221/40384736/attachment-0001.htm>


More information about the Glass mailing list