X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=src%2Fopt_calendar.ml;h=89c5598cbd946f0eb43af366317a073cbcaa7bec;hb=1aedabd0caf7a0562a3f314dddd13d49e0165c92;hp=fd9370464476de72ffaa8e3d30e16381afd9b19a;hpb=4c608eef2274bc267d45d62550aafe2151514013;p=virt-top.git diff --git a/src/opt_calendar.ml b/src/opt_calendar.ml index fd93704..89c5598 100644 --- a/src/opt_calendar.ml +++ b/src/opt_calendar.ml @@ -22,14 +22,18 @@ open CalendarLib open Printf -open ExtString open Opt_gettext.Gettext ;; Top.parse_date_time := fun time -> let cal : Calendar.t = - if String.starts_with time "+" then ( (* +something *) + (* time is "+something" *) + let is_plus = + let n = String.length time in + n >= 1 && time.[0] = '+' + in + if is_plus then ( let period = String.sub time 1 (String.length time - 1) in let period = if String.contains period ':' then ( (* +HH:MM:SS *)