Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: REBOL Documentation Project and Minor Bug report

From: al::bri::xtra::co::nz at: 27-Sep-2001 18:45

/locale Which then leads one to design some month and weekday functions which are locale specific: use [Months Index] [ Months: system/locale/months forall Months [ Index: index? Months system/locale/months do reduce [ to set-word! join first Months "?" 'func [ "Is Date this month?" Date [date!] ] reduce ['= Index 'Date/Month] ] ] ] Month: func [Date [date!]][ pick system/locale/months Date/month ] use [Weekdays Index] [ Weekdays: system/locale/weekdays forall Weekdays [ Index: index? Weekdays system/locale/weekdays do reduce [ to set-word! join first Weekdays "?" 'func [ "Is Date this weekday?" Date [date!] ] reduce ['= Index 'Date/weekday] ] ] ] Weekday: func [Date [date!]][ pick system/locale/weekdays Date/weekday ] and allow these kind of results:
>> now
== 27-Sep-2001/18:43:41+12:00
>> september? now
== true
>> month now
== "September"
>> thursday? now
== true
>> weekday now
== "Thursday" Andrew Martin ICQ: 26227169 http://zen.scripterz.org