|
|
|
Description |
For date and time values, we use the standard Day and UTCTime types.
A SmartDate is a date which may be partially-specified or relative.
Eg 20081231, but also 200812, 1231, tomorrow, last week, next year.
We represent these as a triple of strings like ("2008","12",""),
("","","tomorrow"), ("","last","week").
A DateSpan is the span of time between two specific calendar dates, or
an open-ended span where one or both dates are unspecified. (A date span
with both ends unspecified matches all dates.)
An Interval is ledger's reporting interval - weekly, monthly,
quarterly, etc.
|
|
Synopsis |
|
|
|
Documentation |
|
|
|
|
|
|
|
|
Split a DateSpan into one or more consecutive spans at the specified interval.
|
|
|
|
|
Count the days in a DateSpan, or if it is open-ended return Nothing.
|
|
|
Parse a period expression to an Interval and overall DateSpan using
the provided reference date.
|
|
|
Convert a single smart date string to a date span using the provided
reference date.
|
|
|
|
|
Convert a smart date string to an explicit yyyymmdd string using
the provided reference date.
|
|
|
Convert a SmartDate to an absolute date using the provided reference date.
|
|
|
|
|
|
|
Parse a date-time string to a time type, or raise an error.
|
|
|
Parse a date string to a time type, or raise an error.
|
|
|
Parse a date string to a time type, or raise an error.
|
|
|
Parse a time string to a time type using the provided pattern, or
return the default.
|
|
|
Parse a date in any of the formats allowed in ledger's period expressions,
and maybe some others:
2004
2004/10
2004/10/1
10/1
21
october, oct
yesterday, today, tomorrow
(not yet) this/next/last week/day/month/quarter/year
Returns a SmartDate, to be converted to a full date later (see fixSmartDate).
Assumes any text in the parse stream has been lowercased.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Produced by Haddock version 2.6.0 |