zoneinfo: fix for calendar renaming.
parent
dc08c22a92
commit
8d3acb68f5
|
@ -89,7 +89,7 @@ CONSTANT: month-abbreviations-hash
|
|||
: month-abbreviation ( n -- string )
|
||||
check-month 1 - month-abbreviations nth ;
|
||||
|
||||
: month-abbreviation# ( string -- n )
|
||||
: month-abbreviation-index ( string -- n )
|
||||
month-abbreviations-hash ?at
|
||||
[ not-a-month-abbreviation ] unless ;
|
||||
|
||||
|
@ -577,11 +577,11 @@ CONSTANT: day-predicates
|
|||
|
||||
ERROR: not-a-day-abbreviation string ;
|
||||
|
||||
: day-abbreviation3# ( string -- n )
|
||||
: day-abbreviation3-index ( string -- n )
|
||||
day-abbreviations3-hash ?at [ not-a-day-abbreviation ] unless ; inline
|
||||
|
||||
: day-abbreviation3-predicate ( string -- predicate )
|
||||
day-abbreviation3# day-predicates nth ;
|
||||
day-abbreviation3-index day-predicates nth ;
|
||||
|
||||
: beginning-of-week ( timestamp -- new-timestamp )
|
||||
midnight sunday ;
|
||||
|
|
|
@ -171,16 +171,16 @@ ERROR: zone-not-found name ;
|
|||
! "3", "Thu>=8" always >=, "lastFri"
|
||||
{
|
||||
{ [ dup 3 swap ?nth CHAR: > = ] [
|
||||
3 cut 2 tail [ day-abbreviation3>predicate ] [ string>number ] bi* 2array
|
||||
3 cut 2 tail [ day-abbreviation3-predicate ] [ string>number ] bi* 2array
|
||||
] }
|
||||
{ [ dup "last" head? ] [ 4 tail day-abbreviation3>n ] }
|
||||
{ [ dup "last" head? ] [ 4 tail day-abbreviation3-index ] }
|
||||
[ string>number ]
|
||||
} cond ;
|
||||
|
||||
: raw-rule>triple ( raw-rule -- quot )
|
||||
{
|
||||
[ from>> string>number ]
|
||||
[ in>> month-abbreviation>n ]
|
||||
[ in>> month-abbreviation-index ]
|
||||
[ on>> on>value ]
|
||||
} cleave>array ;
|
||||
|
||||
|
|
Loading…
Reference in New Issue