orgmode-parse-0.1.1.3: A collection of Attoparsec combinators for parsing org-mode flavored documents.

Copyright© 2014 Parnell Springmeyer
LicenseAll Rights Reserved
MaintainerParnell Springmeyer <parnell@digitalmentat.com>
Stabilitystable
Safe HaskellNone
LanguageHaskell2010

Data.OrgMode.Parse.Attoparsec.Time

Description

Parsing combinators for org-mode active and inactive timestamps.

Synopsis

Documentation

parsePlannings :: Parser Text (HashMap PlanningKeyword Timestamp) Source

Parse a planning line.

Plannings inhabit a heading section and are formatted as a keyword and a timestamp. There can be more than one, but they are all on the same line e.g:

DEADLINE: <2015-05-10 17:00> CLOSED: <2015-04-1612:00>

parseClock :: Parser Text (Maybe Timestamp, Maybe Duration) Source

Parse a clock line.

A heading's section contains one line per clock entry. Clocks may have a timestamp, a duration, both, or neither e.g.:

CLOCK: [2014-12-10 Fri 2:30]--[2014-12-10 Fri 10:30] => 08:00

parseTimestamp :: Parser Text Timestamp Source

Parse a timestamp.

Timestamps may be timepoints or timeranges, and they indicate whether they are active or closed by using angle or square brackets respectively.

Time ranges are formatted by infixing two timepoints with a double hyphen, --; or, by appending two hh:mm timestamps together in a single timepoint with one hyphen -.

Each timepoint includes an optional repeater flag and an optional delay flag.

parseBracketedDateTime :: Parser Text BracketedDateTime Source

Parse a single time part.

[2015-03-27 Fri 10:20 +4h]

Returns:

  • The basic timestamp
  • Whether there was a time interval in place of a single time (this will be handled upstream by parseTimestamp)
  • Whether the time is active or inactive

parseDay :: Parser Text Text Source

Parse a day name in the same way as org-mode does.

parseTime' :: Parser Text TimePart Source

Parse the time-of-day part of a time part, as a single point or a time range.

parseDate :: Parser Text YearMonthDay Source

Parse the YYYY-MM-DD part of a time part.

parseHM :: Parser Text (Hours, Minutes) Source

Parse a single HH:MM point.

parseTimeUnit :: Parser Text TimeUnit Source

Parse the Timeunit part of a delay or repeater flag.

parseRepeater :: Parser Text Repeater Source

Parse a repeater flag, e.g. .+4w, or ++1y.

parseDelay :: Parser Text Delay Source

Parse a delay flag, e.g. --1d or -2w.