metar: fix for timestamps like "2124" meaning "2200".

travis-windows
John Benediktsson 2018-11-20 11:41:18 -08:00
parent 9804c3c744
commit d82ce045ea
1 changed files with 5 additions and 1 deletions

View File

@ -141,7 +141,11 @@ MEMO: glossary ( -- assoc )
: parse-timestamp ( str -- str' )
[ now [ year>> ] [ month>> ] bi ] dip
2 cut 2 cut 2 cut drop [ string>number ] tri@
0 instant <timestamp> timestamp>rfc822 ;
over 24 = [
[ drop 0 ] dip 0 instant <timestamp> 1 days time+
] [
0 instant <timestamp>
] if timestamp>rfc822 ;
CONSTANT: compass-directions H{
{ 0.0 "N" }