vueless 0.0.482 → 0.0.484

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,123 @@
1
+ <script setup lang="ts">
2
+ import { computed } from "vue";
3
+
4
+ import { formatDate, dateIsOutOfRange } from "./utilCalendar.ts";
5
+ import { isSameMonth, getDateWithoutTime, isCurrentMonth } from "./utilDate.ts";
6
+
7
+ import useAttrs from "./useAttrs.ts";
8
+
9
+ import { MONTHS_PER_VIEW } from "./constants.ts";
10
+
11
+ import type { UCalendarViewProps, UCalendarProps } from "./types.ts";
12
+
13
+ import UButton from "../ui.button/UButton.vue";
14
+
15
+ const props = defineProps<UCalendarViewProps>();
16
+
17
+ const emit = defineEmits(["input"]);
18
+
19
+ const {
20
+ monthViewAttrs,
21
+ monthAttrs,
22
+ currentMonthAttrs,
23
+ currentMonthInRangeAttrs,
24
+ lastMonthInRangeAttrs,
25
+ firstMonthInRangeAttrs,
26
+ singleMonthInRangeAttrs,
27
+ monthInRangeAttrs,
28
+ selectedMonthAttrs,
29
+ activeMonthAttrs,
30
+ currentLastMonthInRangeAttrs,
31
+ currentFirstMonthInRangeAttrs,
32
+ singleCurrentMonthInRangeAttrs,
33
+ } = useAttrs(props as unknown as UCalendarProps);
34
+
35
+ const localSelectedDate = computed(() => {
36
+ return props.selectedDate === null ? getDateWithoutTime() : props.selectedDate;
37
+ });
38
+
39
+ const localActiveMonth = computed(
40
+ () => props.activeMonth || props.activeDate || localSelectedDate.value,
41
+ );
42
+
43
+ const months = computed(() =>
44
+ Array.from({ length: MONTHS_PER_VIEW }, (_, i) => i).map((monthNumber) => getMonth(monthNumber)),
45
+ );
46
+
47
+ function getMonth(monthNumber: number) {
48
+ let newDate = new Date(localActiveMonth.value.valueOf());
49
+
50
+ newDate.setMonth(monthNumber);
51
+
52
+ // Means the current day has less days so the extra month is
53
+ // in the following month
54
+ if (newDate.getDate() !== localActiveMonth.value.getDate()) {
55
+ // Assign the last day of previous month
56
+ newDate = new Date(newDate.getFullYear(), newDate.getMonth(), 0);
57
+ }
58
+
59
+ return newDate;
60
+ }
61
+
62
+ function getMonthState(month: Date, index: number) {
63
+ const startRangeIndex = months.value.findIndex((month) => {
64
+ return isSameMonth(month, localSelectedDate.value);
65
+ });
66
+
67
+ const endRangeIndex = months.value.findIndex((month) => {
68
+ return props.selectedDateTo && isSameMonth(month, props.selectedDateTo);
69
+ });
70
+
71
+ const isMonthInRange =
72
+ (index >= startRangeIndex && index <= endRangeIndex) ||
73
+ (index >= startRangeIndex && endRangeIndex === -1);
74
+ const isSelectedMonth =
75
+ isSameMonth(month, localSelectedDate.value) && props.selectedDate !== null;
76
+ const isPresentMonth = isCurrentMonth(month);
77
+ const isMoreThanOneMonthRange =
78
+ props.range &&
79
+ props.selectedDateTo &&
80
+ props.selectedDate &&
81
+ isMoreThanOneMonthDiff(props.selectedDate, props.selectedDateTo);
82
+ const isActiveMonth = props.activeMonth && isSameMonth(props.activeMonth, month) && !props.range;
83
+ const isCurrentMonthInRange = isMonthInRange && isPresentMonth;
84
+ const isLastMonthInRange =
85
+ props.selectedDateTo &&
86
+ props.range &&
87
+ isSameMonth(month, props.selectedDateTo) &&
88
+ isMoreThanOneMonthRange;
89
+ const isFirstMonthInRange =
90
+ props.range && isSameMonth(month, localSelectedDate.value) && isMoreThanOneMonthRange;
91
+ const isCurrentFirstMonthInRange = props.range && isFirstMonthInRange && isPresentMonth;
92
+ const isCurrentLastMonthInRange = props.range && isLastMonthInRange && isPresentMonth;
93
+
94
+ return {
95
+ isSelectedMonth,
96
+ isCurrentMonth: isPresentMonth,
97
+ isMoreThanOneMonthRange,
98
+ isActiveMonth,
99
+ isCurrentMonthInRange,
100
+ isLastMonthInRange,
101
+ isFirstMonthInRange,
102
+ isCurrentFirstMonthInRange,
103
+ isCurrentLastMonthInRange,
104
+ isMonthInRange,
105
+ };
106
+ }
107
+
108
+ function isMoreThanOneMonthDiff(date: Date, dateTo: Date) {
109
+ const yearDiff = Math.abs(dateTo.getFullYear() - date.getFullYear());
110
+ const monthDiff = Math.abs(dateTo.getMonth() - date.getMonth());
111
+ const dayDiff = Math.abs(dateTo.getDate() - date.getDate());
112
+
113
+ return yearDiff > 0 || monthDiff > 1 || (monthDiff === 1 && dayDiff > 0);
114
+ }
115
+
116
+ function onClickMonth(month: Date) {
117
+ emit("input", month);
118
+ }
119
+ </script>
120
+
1
121
  <template>
2
122
  <div v-bind="monthViewAttrs">
3
123
  <template v-for="(month, idx) in months" :key="month">
@@ -162,167 +282,3 @@
162
282
  </template>
163
283
  </div>
164
284
  </template>
165
-
166
- <script setup>
167
- import { computed } from "vue";
168
-
169
- import { formatDate, dateIsOutOfRange } from "./utilCalendar.js";
170
- import { isSameMonth, getDateWithoutTime, isCurrentMonth } from "./utilDate.js";
171
-
172
- import useAttrs from "./useAttrs.js";
173
-
174
- import { MONTHS_PER_VIEW } from "./constants.js";
175
-
176
- import UButton from "../ui.button/UButton.vue";
177
-
178
- const props = defineProps({
179
- selectedDate: {
180
- type: [Date, null],
181
- required: true,
182
- },
183
-
184
- selectedDateTo: {
185
- type: [Date, null],
186
- default: undefined,
187
- },
188
-
189
- activeDate: {
190
- type: [Date, null],
191
- required: true,
192
- },
193
-
194
- activeMonth: {
195
- type: [Date, null],
196
- required: true,
197
- },
198
-
199
- locale: {
200
- type: Object,
201
- required: true,
202
- },
203
-
204
- dateFormat: {
205
- type: String,
206
- default: undefined,
207
- },
208
-
209
- range: {
210
- type: Boolean,
211
- default: false,
212
- },
213
-
214
- maxDate: {
215
- type: [Date, String],
216
- default: undefined,
217
- },
218
-
219
- minDate: {
220
- type: [Date, String],
221
- default: undefined,
222
- },
223
-
224
- config: {
225
- type: Object,
226
- default: () => ({}),
227
- },
228
- });
229
-
230
- const emit = defineEmits(["input"]);
231
-
232
- const {
233
- monthViewAttrs,
234
- monthAttrs,
235
- currentMonthAttrs,
236
- currentMonthInRangeAttrs,
237
- lastMonthInRangeAttrs,
238
- firstMonthInRangeAttrs,
239
- singleMonthInRangeAttrs,
240
- monthInRangeAttrs,
241
- selectedMonthAttrs,
242
- activeMonthAttrs,
243
- currentLastMonthInRangeAttrs,
244
- currentFirstMonthInRangeAttrs,
245
- singleCurrentMonthInRangeAttrs,
246
- } = useAttrs(props);
247
-
248
- const localSelectedDate = computed(() => {
249
- return props.selectedDate === null ? getDateWithoutTime() : props.selectedDate;
250
- });
251
-
252
- const localActiveMonth = computed(
253
- () => props.activeMonth || props.activeDate || localSelectedDate.value,
254
- );
255
-
256
- const months = computed(() =>
257
- Array.from({ length: MONTHS_PER_VIEW }, (_, i) => i).map((monthNumber) => getMonth(monthNumber)),
258
- );
259
-
260
- function getMonth(monthNumber) {
261
- let newDate = new Date(localActiveMonth.value.valueOf());
262
-
263
- newDate.setMonth(monthNumber);
264
-
265
- // Means the current day has less days so the extra month is
266
- // in the following month
267
- if (newDate.getDate() !== localActiveMonth.value.getDate()) {
268
- // Assign the last day of previous month
269
- newDate = new Date(newDate.getFullYear(), newDate.getMonth(), 0);
270
- }
271
-
272
- return newDate;
273
- }
274
-
275
- function getMonthState(month, index) {
276
- const startRangeIndex = months.value.findIndex((month) => {
277
- return isSameMonth(month, localSelectedDate.value);
278
- });
279
-
280
- const endRangeIndex = months.value.findIndex((month) => {
281
- return isSameMonth(month, props.selectedDateTo);
282
- });
283
-
284
- const isMonthInRange =
285
- (index >= startRangeIndex && index <= endRangeIndex) ||
286
- (index >= startRangeIndex && endRangeIndex === -1);
287
- const isSelectedMonth =
288
- isSameMonth(month, localSelectedDate.value) && props.selectedDate !== null;
289
- const isPresentMonth = isCurrentMonth(month);
290
- const isMoreThanOneMonthRange =
291
- props.range &&
292
- props.selectedDateTo &&
293
- isMoreThanOneMonthDiff(props.selectedDate, props.selectedDateTo);
294
- const isActiveMonth = isSameMonth(props.activeMonth, month) && !props.range;
295
- const isCurrentMonthInRange = isMonthInRange && isPresentMonth;
296
- const isLastMonthInRange =
297
- props.range && isSameMonth(month, props.selectedDateTo) && isMoreThanOneMonthRange;
298
- const isFirstMonthInRange =
299
- props.range && isSameMonth(month, localSelectedDate.value) && isMoreThanOneMonthRange;
300
- const isCurrentFirstMonthInRange = props.range && isFirstMonthInRange && isPresentMonth;
301
- const isCurrentLastMonthInRange = props.range && isLastMonthInRange && isPresentMonth;
302
-
303
- return {
304
- isSelectedMonth,
305
- isCurrentMonth: isPresentMonth,
306
- isMoreThanOneMonthRange,
307
- isActiveMonth,
308
- isCurrentMonthInRange,
309
- isLastMonthInRange,
310
- isFirstMonthInRange,
311
- isCurrentFirstMonthInRange,
312
- isCurrentLastMonthInRange,
313
- isMonthInRange,
314
- };
315
- }
316
-
317
- function isMoreThanOneMonthDiff(date, dateTo) {
318
- const yearDiff = Math.abs(dateTo.getFullYear() - date.getFullYear());
319
- const monthDiff = Math.abs(dateTo.getMonth() - date.getMonth());
320
- const dayDiff = Math.abs(dateTo.getDate() - date.getDate());
321
-
322
- return yearDiff > 0 || monthDiff > 1 || (monthDiff === 1 && dayDiff > 0);
323
- }
324
-
325
- function onClickMonth(month) {
326
- emit("input", month);
327
- }
328
- </script>
@@ -1,3 +1,121 @@
1
+ <script setup lang="ts">
2
+ import { computed } from "vue";
3
+
4
+ import { formatDate, getYearsRange, dateIsOutOfRange } from "./utilCalendar.ts";
5
+ import { isSameMonth, getDateWithoutTime, isCurrentYear } from "./utilDate.ts";
6
+
7
+ import useAttrs from "./useAttrs.ts";
8
+
9
+ import { YEARS_PER_VIEW } from "./constants.ts";
10
+
11
+ import type { UCalendarProps, UCalendarViewProps } from "./types.ts";
12
+
13
+ import UButton from "../ui.button/UButton.vue";
14
+
15
+ const props = defineProps<UCalendarViewProps>();
16
+
17
+ const emit = defineEmits(["input"]);
18
+
19
+ const {
20
+ yearViewAttrs,
21
+ yearAttrs,
22
+ currentYearAttrs,
23
+ currentYearInRangeAttrs,
24
+ firstYearInRangeAttrs,
25
+ lastYearInRangeAttrs,
26
+ yearInRangeAttrs,
27
+ singleYearInRangeAttrs,
28
+ selectedYearAttrs,
29
+ activeYearAttrs,
30
+ singleCurrentYearInRangeAttrs,
31
+ currentLastYearInRangeAttrs,
32
+ currentFirstYearInRangeAttrs,
33
+ } = useAttrs(props as unknown as UCalendarProps);
34
+
35
+ const localSelectedDate = computed(() => {
36
+ return props.selectedDate === null ? getDateWithoutTime() : props.selectedDate;
37
+ });
38
+
39
+ const localActiveMonth = computed(
40
+ () => props.activeMonth || props.activeDate || localSelectedDate.value,
41
+ );
42
+
43
+ const years = computed(() => {
44
+ const [initialYear] = getYearsRange(localActiveMonth.value);
45
+
46
+ return Array.from({ length: YEARS_PER_VIEW }, (_, i) => i).map((year) =>
47
+ getYear(initialYear + year),
48
+ );
49
+ });
50
+
51
+ function getYear(year: number) {
52
+ let newDate = new Date(localActiveMonth.value.valueOf());
53
+
54
+ newDate.setFullYear(year);
55
+
56
+ // Means the current day has less days so the extra month is
57
+ // in the following month
58
+ if (newDate.getDate() !== localActiveMonth.value.getDate()) {
59
+ // Assign the last day of previous month
60
+ newDate = new Date(newDate.getFullYear(), newDate.getMonth(), 0);
61
+ }
62
+
63
+ return newDate;
64
+ }
65
+
66
+ function getYearState(year: Date, index: number) {
67
+ const startRangeIndex = years.value.findIndex((year) => {
68
+ return year.getFullYear() === localSelectedDate.value?.getFullYear();
69
+ });
70
+
71
+ const endRangeIndex = years.value.findIndex((year) => {
72
+ return year.getFullYear() === props.selectedDateTo?.getFullYear();
73
+ });
74
+
75
+ const isYearInRange =
76
+ (index >= startRangeIndex && index <= endRangeIndex) ||
77
+ (index >= startRangeIndex && endRangeIndex === -1);
78
+ const isSelectedYear = isSameMonth(year, localSelectedDate.value) && props.selectedDate !== null;
79
+ const isPresentYear = isCurrentYear(year);
80
+ const isMoreThanOneYearRange =
81
+ props.selectedDateTo &&
82
+ props.selectedDate &&
83
+ props.selectedDateTo.getFullYear() - props.selectedDate.getFullYear() >= 1;
84
+ const isActiveYear = props.activeMonth && isSameMonth(props.activeMonth, year) && !props.range;
85
+ const isCurrentYearInRange = isYearInRange && isPresentYear;
86
+
87
+ const isLastYearInRange =
88
+ props.range &&
89
+ year.getFullYear() === props.selectedDateTo?.getFullYear() &&
90
+ isMoreThanOneYearRange;
91
+
92
+ const isFirstYearInRange =
93
+ props.range &&
94
+ year.getFullYear() === localSelectedDate.value?.getFullYear() &&
95
+ isMoreThanOneYearRange;
96
+
97
+ const isCurrentFirstYearInRange = props.range && isFirstYearInRange && isPresentYear;
98
+ const isCurrentLastYearInRange = props.range && isLastYearInRange && isPresentYear;
99
+
100
+ return {
101
+ isSelectedYear,
102
+ isCurrentYear: isPresentYear,
103
+ isMoreThanOneYearRange,
104
+ isActiveYear,
105
+ isCurrentYearInRange,
106
+ isLastYearInRange,
107
+ isFirstYearInRange,
108
+ isCurrentFirstYearInRange,
109
+ isCurrentLastYearInRange,
110
+ isYearInRange,
111
+ };
112
+ }
113
+
114
+ function onClickYear(year: Date) {
115
+ emit("input", year);
116
+ }
117
+ </script>
118
+
1
119
  <template>
2
120
  <div v-bind="yearViewAttrs">
3
121
  <template v-for="(year, idx) in years" :key="year">
@@ -158,167 +276,3 @@
158
276
  </template>
159
277
  </div>
160
278
  </template>
161
-
162
- <script setup>
163
- import { computed } from "vue";
164
-
165
- import { formatDate, getYearsRange, dateIsOutOfRange } from "./utilCalendar.js";
166
- import { isSameMonth, getDateWithoutTime, isCurrentYear } from "./utilDate.js";
167
-
168
- import useAttrs from "./useAttrs.js";
169
-
170
- import { YEARS_PER_VIEW } from "./constants.js";
171
-
172
- import UButton from "../ui.button/UButton.vue";
173
-
174
- const props = defineProps({
175
- selectedDate: {
176
- type: [Date, null],
177
- required: true,
178
- },
179
-
180
- selectedDateTo: {
181
- type: [Date, null],
182
- default: undefined,
183
- },
184
-
185
- activeDate: {
186
- type: [Date, null],
187
- required: true,
188
- },
189
-
190
- activeMonth: {
191
- type: [Date, null],
192
- required: true,
193
- },
194
-
195
- locale: {
196
- type: Object,
197
- required: true,
198
- },
199
-
200
- dateFormat: {
201
- type: String,
202
- default: undefined,
203
- },
204
-
205
- range: {
206
- type: Boolean,
207
- default: false,
208
- },
209
-
210
- maxDate: {
211
- type: [Date, String],
212
- default: undefined,
213
- },
214
-
215
- minDate: {
216
- type: [Date, String],
217
- default: undefined,
218
- },
219
-
220
- config: {
221
- type: Object,
222
- default: () => ({}),
223
- },
224
- });
225
-
226
- const emit = defineEmits(["input"]);
227
-
228
- const {
229
- yearViewAttrs,
230
- yearAttrs,
231
- currentYearAttrs,
232
- currentYearInRangeAttrs,
233
- firstYearInRangeAttrs,
234
- lastYearInRangeAttrs,
235
- yearInRangeAttrs,
236
- singleYearInRangeAttrs,
237
- selectedYearAttrs,
238
- activeYearAttrs,
239
- singleCurrentYearInRangeAttrs,
240
- currentLastYearInRangeAttrs,
241
- currentFirstYearInRangeAttrs,
242
- } = useAttrs(props);
243
-
244
- const localSelectedDate = computed(() => {
245
- return props.selectedDate === null ? getDateWithoutTime() : props.selectedDate;
246
- });
247
-
248
- const localActiveMonth = computed(
249
- () => props.activeMonth || props.activeDate || localSelectedDate.value,
250
- );
251
-
252
- const years = computed(() => {
253
- const [initialYear] = getYearsRange(localActiveMonth.value, YEARS_PER_VIEW);
254
-
255
- return Array.from({ length: YEARS_PER_VIEW }, (_, i) => i).map((year) =>
256
- getYear(initialYear + year),
257
- );
258
- });
259
-
260
- function getYear(year) {
261
- let newDate = new Date(localActiveMonth.value.valueOf());
262
-
263
- newDate.setFullYear(year);
264
-
265
- // Means the current day has less days so the extra month is
266
- // in the following month
267
- if (newDate.getDate() !== localActiveMonth.value.getDate()) {
268
- // Assign the last day of previous month
269
- newDate = new Date(newDate.getFullYear(), newDate.getMonth(), 0);
270
- }
271
-
272
- return newDate;
273
- }
274
-
275
- function getYearState(year, index) {
276
- const startRangeIndex = years.value.findIndex((year) => {
277
- return year.getFullYear() === localSelectedDate.value?.getFullYear();
278
- });
279
-
280
- const endRangeIndex = years.value.findIndex((year) => {
281
- return year.getFullYear() === props.selectedDateTo?.getFullYear();
282
- });
283
-
284
- const isYearInRange =
285
- (index >= startRangeIndex && index <= endRangeIndex) ||
286
- (index >= startRangeIndex && endRangeIndex === -1);
287
- const isSelectedYear = isSameMonth(year, localSelectedDate.value) && props.selectedDate !== null;
288
- const isPresentYear = isCurrentYear(year);
289
- const isMoreThanOneYearRange =
290
- props.selectedDateTo?.getFullYear() - props.selectedDate?.getFullYear() >= 1;
291
- const isActiveYear = isSameMonth(props.activeMonth, year) && !props.range;
292
- const isCurrentYearInRange = isYearInRange && isPresentYear;
293
-
294
- const isLastYearInRange =
295
- props.range &&
296
- year.getFullYear() === props.selectedDateTo?.getFullYear() &&
297
- isMoreThanOneYearRange;
298
-
299
- const isFirstYearInRange =
300
- props.range &&
301
- year.getFullYear() === localSelectedDate.value?.getFullYear() &&
302
- isMoreThanOneYearRange;
303
-
304
- const isCurrentFirstYearInRange = props.range && isFirstYearInRange && isPresentYear;
305
- const isCurrentLastYearInRange = props.range && isLastYearInRange && isPresentYear;
306
-
307
- return {
308
- isSelectedYear,
309
- isCurrentYear: isPresentYear,
310
- isMoreThanOneYearRange,
311
- isActiveYear,
312
- isCurrentYearInRange,
313
- isLastYearInRange,
314
- isFirstYearInRange,
315
- isCurrentFirstYearInRange,
316
- isCurrentLastYearInRange,
317
- isYearInRange,
318
- };
319
- }
320
-
321
- function onClickYear(year) {
322
- emit("input", year);
323
- }
324
- </script>
@@ -153,8 +153,6 @@ export default /*tw*/ {
153
153
  timepicker: false,
154
154
  dateFormat: undefined,
155
155
  dateTimeFormat: undefined,
156
- maxDate: undefined,
157
- minDate: undefined,
158
156
  /* icons */
159
157
  viewSwitchIcon: "keyboard_arrow_down",
160
158
  nextIcon: "keyboard_arrow_right",
@@ -21,6 +21,35 @@ export const MAX_SECONDS = 59;
21
21
  export const MIN_SECONDS = 0;
22
22
  export const SEPARATOR = "—";
23
23
 
24
+ export enum LocaleType {
25
+ Day = "day",
26
+ Month = "month",
27
+ }
28
+
29
+ export enum KeyCode {
30
+ ArrowLeft = "ArrowLeft",
31
+ ArrowUp = "ArrowUp",
32
+ ArrowRight = "ArrowRight",
33
+ ArrowDown = "ArrowDown",
34
+ Enter = "Enter",
35
+ Escape = "Escape",
36
+ Space = " Space",
37
+ Backspace = "Backspace",
38
+ }
39
+
40
+ export enum View {
41
+ Day = "day",
42
+ Month = "month",
43
+ Year = "year",
44
+ }
45
+
46
+ export enum InputType {
47
+ Hours,
48
+ Minutes,
49
+ Seconds,
50
+ }
51
+
52
+ // TODO: Remove redundant arrays when other components migrated to ts;
24
53
  export const LOCALE_TYPE = {
25
54
  day: "day",
26
55
  month: "month",
@@ -32,22 +61,12 @@ export const VIEW = {
32
61
  year: "year",
33
62
  };
34
63
 
35
- export const INPUT_TYPE = {
36
- hours: "hours",
37
- minutes: "minutes",
38
- seconds: "seconds",
39
- };
40
-
41
- export const KEY_CODE = {
42
- left: 37,
43
- up: 38,
44
- right: 39,
45
- down: 40,
46
- enter: 13,
47
- esc: 27,
48
- space: 32,
49
- backspace: 8,
50
- };
64
+ export const ARROW_KEYS: string[] = [
65
+ KeyCode.ArrowLeft,
66
+ KeyCode.ArrowUp,
67
+ KeyCode.ArrowRight,
68
+ KeyCode.ArrowDown,
69
+ ];
51
70
 
52
71
  export const TOKEN_REG_EXP = {
53
72
  D: "(\\w+)",
@@ -1,8 +1,8 @@
1
1
  import { Meta, Title, Subtitle, Description, Primary, Controls, Stories, Source, Markdown } from "@storybook/blocks";
2
2
  import { getSource } from "../../utils/storybook.ts";
3
3
 
4
- import * as stories from "./stories.js";
5
- import defaultConfig from "../config.js?raw"
4
+ import * as stories from "./stories.ts";
5
+ import defaultConfig from "../config.ts?raw"
6
6
 
7
7
  <Meta of={stories} />
8
8
  <Title of={stories} />
@@ -26,7 +26,6 @@ Each character in the table below can be used in `dateFormat` and `userFormat` o
26
26
  | D | A textual representation of a day | Mon through Sun |
27
27
  | l | A full textual representation of the day of the week | Sunday through Saturday |
28
28
  | j | Day of the month without leading zeros | 1 to 31 |
29
- | J | Day of the month without leading zeros and ordinal suffix | 1st, 2nd, to 31st |
30
29
  | w | Numeric representation of the day of the week | 0 (for Sunday) through 6 (for Saturday) |
31
30
  | W | Numeric representation of the week | 0 (first week of the year) through 52 (last week of the year) |
32
31
  | F | A full textual representation of a month | January through December |