or as an HTML document.
+.. option:: --first-weekday WEEKDAY, -f WEEKDAY
+
+ The weekday to start each week.
+ Must be a number between 0 (Monday) and 6 (Sunday).
+ Defaults to 0.
+
+
.. option:: year
The year to print the calendar for.
- Must be a number between 1 and 9999.
Defaults to the current year.
choices=("text", "html"),
help="output type (text or html)"
)
+ parser.add_argument(
+ "-f", "--first-weekday",
+ type=int, default=0,
+ help="weekday (0 is Monday, 6 is Sunday) to start each week (default 0)"
+ )
parser.add_argument(
"year",
nargs='?', type=int,
cal = LocaleHTMLCalendar(locale=locale)
else:
cal = HTMLCalendar()
+ cal.setfirstweekday(options.first_weekday)
encoding = options.encoding
if encoding is None:
encoding = sys.getdefaultencoding()
cal = LocaleTextCalendar(locale=locale)
else:
cal = TextCalendar()
+ cal.setfirstweekday(options.first_weekday)
optdict = dict(w=options.width, l=options.lines)
if options.month is None:
optdict["c"] = options.spacing