picocrank 1.19.0 → 1.20.0
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.
package/package.json
CHANGED
|
@@ -46,6 +46,8 @@ export interface CalendarProps {
|
|
|
46
46
|
formatEventTime?: (event: CalendarEvent, date: Date) => string
|
|
47
47
|
// Customization
|
|
48
48
|
showNavigation?: boolean
|
|
49
|
+
/** When true, day titles show ordinal + full month name (e.g. "21st July") instead of the day number alone. */
|
|
50
|
+
shortMonthSuffix?: boolean
|
|
49
51
|
currentMonth?: number
|
|
50
52
|
currentYear?: number
|
|
51
53
|
}
|
|
@@ -62,6 +64,7 @@ const props = withDefaults(defineProps<CalendarProps>(), {
|
|
|
62
64
|
eventDragEnabled: true,
|
|
63
65
|
eventMoveResponseTimeoutMs: 15000,
|
|
64
66
|
showNavigation: true,
|
|
67
|
+
shortMonthSuffix: false,
|
|
65
68
|
})
|
|
66
69
|
|
|
67
70
|
const emit = defineEmits<{
|
|
@@ -646,8 +649,16 @@ watch([currentMonth, currentYear], () => {
|
|
|
646
649
|
}"
|
|
647
650
|
>
|
|
648
651
|
<div class="day-content">
|
|
649
|
-
<div
|
|
650
|
-
|
|
652
|
+
<div
|
|
653
|
+
class="day-number clickable"
|
|
654
|
+
:class="{ 'with-month-suffix': shortMonthSuffix }"
|
|
655
|
+
>
|
|
656
|
+
<template v-if="shortMonthSuffix">
|
|
657
|
+
{{ day.date.getDate() }}{{ getOrdinalSuffix(day.date.getDate()) }} {{ monthNames[day.date.getMonth()] }}
|
|
658
|
+
</template>
|
|
659
|
+
<template v-else>
|
|
660
|
+
{{ day.date.getDate() }}<span class="day-month">{{ getOrdinalSuffix(day.date.getDate()) }} {{ monthNames[day.date.getMonth()].substring(0, 3) }}</span>
|
|
661
|
+
</template>
|
|
651
662
|
</div>
|
|
652
663
|
<div class="day-events">
|
|
653
664
|
<div
|
|
@@ -913,6 +924,13 @@ watch([currentMonth, currentYear], () => {
|
|
|
913
924
|
font-size: small;
|
|
914
925
|
}
|
|
915
926
|
|
|
927
|
+
.day-number.with-month-suffix {
|
|
928
|
+
min-width: auto;
|
|
929
|
+
text-align: center;
|
|
930
|
+
font-size: 0.8rem;
|
|
931
|
+
white-space: nowrap;
|
|
932
|
+
}
|
|
933
|
+
|
|
916
934
|
.day-content:hover .day-number.clickable {
|
|
917
935
|
color: #007bff;
|
|
918
936
|
}
|
|
@@ -4,6 +4,10 @@
|
|
|
4
4
|
padding
|
|
5
5
|
>
|
|
6
6
|
<template #toolbar>
|
|
7
|
+
<label class="short-month-suffix-toggle">
|
|
8
|
+
<input type="checkbox" v-model="shortMonthSuffix" />
|
|
9
|
+
Short month suffix
|
|
10
|
+
</label>
|
|
7
11
|
<button @click="goToToday">Today</button>
|
|
8
12
|
<button @click="previousMonth">‹</button>
|
|
9
13
|
<div class="date-picker-container">
|
|
@@ -23,6 +27,7 @@
|
|
|
23
27
|
:loading="loading"
|
|
24
28
|
:error="error"
|
|
25
29
|
:show-navigation="false"
|
|
30
|
+
:short-month-suffix="shortMonthSuffix"
|
|
26
31
|
:current-month="currentMonthIndex"
|
|
27
32
|
:current-year="currentYear"
|
|
28
33
|
@event-click="handleEventClick"
|
|
@@ -51,6 +56,7 @@ import {
|
|
|
51
56
|
const events = ref([])
|
|
52
57
|
const loading = ref(false)
|
|
53
58
|
const error = ref(null)
|
|
59
|
+
const shortMonthSuffix = ref(false)
|
|
54
60
|
const currentMonth = ref('?')
|
|
55
61
|
const currentMonthIndex = ref(new Date().getMonth())
|
|
56
62
|
const currentYear = ref(new Date().getFullYear())
|
|
@@ -401,6 +407,15 @@ onMounted(() => {
|
|
|
401
407
|
</script>
|
|
402
408
|
|
|
403
409
|
<style scoped>
|
|
410
|
+
.short-month-suffix-toggle {
|
|
411
|
+
display: inline-flex;
|
|
412
|
+
align-items: center;
|
|
413
|
+
gap: 0.35rem;
|
|
414
|
+
font-size: 0.875rem;
|
|
415
|
+
cursor: pointer;
|
|
416
|
+
user-select: none;
|
|
417
|
+
}
|
|
418
|
+
|
|
404
419
|
.date-picker-container {
|
|
405
420
|
display: flex;
|
|
406
421
|
align-items: center;
|