| 69 | |
| 70 | |
| 71 | class _localized_day: |
| 72 | |
| 73 | # January 1, 2001, was a Monday. |
| 74 | _days = [datetime.date(2001, 1, i+1).strftime for i in range(7)] |
| 75 | |
| 76 | def __init__(self, format): |
| 77 | self.format = format |
| 78 | |
| 79 | def __getitem__(self, i): |
| 80 | funcs = self._days[i] |
| 81 | if isinstance(i, slice): |
| 82 | return [f(self.format) for f in funcs] |
| 83 | else: |
| 84 | return funcs(self.format) |
| 85 | |
| 86 | def __len__(self): |
| 87 | return 7 |
| 88 | |
| 89 | |
| 90 | # Full and abbreviated names of weekdays |