File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55--------
66
77
8- ..note: base converter is pretty developer-facing documentation;
9- .. calendar/converter usage would be helpful to add
8+ .. automodule :: undate.converters
9+
10+ -----
1011
1112.. automodule :: undate.converters.base
1213 :members:
@@ -42,6 +43,8 @@ Extended Date-Time Format (EDTF)
4243Calendars
4344---------
4445
46+ .. automodule :: undate.converters.calendars
47+
4548Gregorian
4649^^^^^^^^^
4750
Original file line number Diff line number Diff line change 1+ """
2+ Converter classes add support for parsing and serializing dates
3+ in a variety of formats. A subset of these are calendar converters
4+ (:mod:`undate.converters.calendar`), which means they support both parsing
5+ and conversion from an alternate calendar to a common Gregorian
6+ for comparison across dates.
7+
8+ To parse a date with a supported converter, use the ``Undate`` class method
9+ :meth:`~undate.undate.Undate.parse` and specify the date as a string
10+ with the desired format or calendar, e.g.
11+
12+ .. code-block::
13+
14+ Undate.parse("2001-05", "EDTF")
15+ Undate.parse("7 Heshvan 5425", "Hebrew")
16+
17+ For converters that support it, you can also serialize a date in a specified
18+ format with ``Undate`` class method :meth:`~undate.undate.Undate.format`:
19+
20+ .. code-block::
21+
22+ Undate.parse("Rabīʿ ath-Thānī 343", "Islamic").format("EDTF")
23+
24+
25+ """
26+
127from undate .converters .base import BaseDateConverter , GRAMMAR_FILE_PATH
228
329__all__ = ["BaseDateConverter" , "GRAMMAR_FILE_PATH" ]
You can’t perform that action at this time.
0 commit comments