Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[fix] date: timezone scan

  • Loading branch information...
commit 90be104818ee23beaf8d9fd96841e22f57e95453 1 parent a2f4a8b
@Aqua-Ye Aqua-Ye authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 stdlib/core/date/date_private.opa
View
5 stdlib/core/date/date_private.opa
@@ -305,8 +305,9 @@ import stdlib.core.parser
parse_num(f) =
parser Rule.ws v=Rule.natural -> f(v)
- parse_timezone(f) =
- parser Rule.ws s=("+"|"-") h=Rule.fixed_length_natural(2) m=Rule.fixed_length_natural(2) -> f((Text.to_string(s), h, m))
+ parse_timezone(f) = parser
+ | Rule.ws "GMT" -> identity
+ | Rule.ws s=("+"|"-") h=Rule.fixed_length_natural(2) m=Rule.fixed_length_natural(2) (Rule.ws "(" (!")" .)* ")")? -> f((Text.to_string(s), h, m))
update_am(d : Date.human_readable) = {d with h = if d.h == 12 then 0 else d.h}
update_pm(d : Date.human_readable) = {d with h = if d.h == 12 then 12 else d.h + 12}
Please sign in to comment.
Something went wrong with that request. Please try again.