| 113 | |
| 114 | |
| 115 | class _localized_day: |
| 116 | |
| 117 | # January 1, 2001, was a Monday. |
| 118 | _days = [datetime.date(2001, 1, i+1).strftime for i in range(7)] |
| 119 | |
| 120 | def __init__(self, format): |
| 121 | self.format = format |
| 122 | |
| 123 | def __getitem__(self, i): |
| 124 | funcs = self._days[i] |
| 125 | if isinstance(i, slice): |
| 126 | return [f(self.format) for f in funcs] |
| 127 | else: |
| 128 | return funcs(self.format) |
| 129 | |
| 130 | def __len__(self): |
| 131 | return 7 |
| 132 | |
| 133 | |
| 134 | # Full and abbreviated names of weekdays |