-
Repeat on:
-
@@ -305,19 +556,27 @@ const formattedOccurrenceShort = computed(() => {
-
-
+
+
-
+
-
+
@@ -329,8 +588,8 @@ const formattedOccurrenceShort = computed(() => {
diff --git a/src/components/WeekdaySelector.vue b/src/components/WeekdaySelector.vue
new file mode 100644
index 0000000..6df4a42
--- /dev/null
+++ b/src/components/WeekdaySelector.vue
@@ -0,0 +1,249 @@
+
+
+
+
+
+
+
+
+
+
diff --git a/src/main.js b/src/main.js
index 963ce07..a7a997b 100644
--- a/src/main.js
+++ b/src/main.js
@@ -10,4 +10,3 @@ const app = createApp(App)
app.use(createPinia())
app.mount('#app')
-
diff --git a/src/utils/date.js b/src/utils/date.js
index 594d33c..a15c795 100644
--- a/src/utils/date.js
+++ b/src/utils/date.js
@@ -1,5 +1,18 @@
// date-utils.js — Date handling utilities for the calendar
-const monthAbbr = ['jan','feb','mar','apr','may','jun','jul','aug','sep','oct','nov','dec']
+const monthAbbr = [
+ 'jan',
+ 'feb',
+ 'mar',
+ 'apr',
+ 'may',
+ 'jun',
+ 'jul',
+ 'aug',
+ 'sep',
+ 'oct',
+ 'nov',
+ 'dec',
+]
const DAY_MS = 86400000
const WEEK_MS = 7 * DAY_MS
@@ -8,7 +21,7 @@ const WEEK_MS = 7 * DAY_MS
* @param {Date} date - The date to get week info for
* @returns {Object} Object containing week number and year
*/
-const isoWeekInfo = date => {
+const isoWeekInfo = (date) => {
const d = new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate()))
const day = d.getUTCDay() || 7
d.setUTCDate(d.getUTCDate() + 4 - day)
@@ -24,7 +37,7 @@ const isoWeekInfo = date => {
* @returns {string} Date string in YYYY-MM-DD format
*/
function toLocalString(date = new Date()) {
- const pad = n => String(Math.floor(Math.abs(n))).padStart(2, '0')
+ const pad = (n) => String(Math.floor(Math.abs(n))).padStart(2, '0')
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`
}
@@ -43,14 +56,14 @@ function fromLocalString(dateString) {
* @param {Date} d - The date
* @returns {number} Monday index (0-6)
*/
-const mondayIndex = d => (d.getDay() + 6) % 7
+const mondayIndex = (d) => (d.getDay() + 6) % 7
/**
* Pad a number with leading zeros to make it 2 digits
* @param {number} n - Number to pad
* @returns {string} Padded string
*/
-const pad = n => String(n).padStart(2, '0')
+const pad = (n) => String(n).padStart(2, '0')
/**
* Calculate number of days between two date strings (inclusive)
@@ -133,12 +146,12 @@ function lunarPhaseSymbol(date) {
// Use UTC noon of given date to reduce timezone edge effects
const dUTC = Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), 12, 0, 0)
const daysSince = (dUTC - ref) / DAY_MS
- const phase = ((daysSince / synodic) % 1 + 1) % 1
+ const phase = (((daysSince / synodic) % 1) + 1) % 1
const phases = [
{ t: 0.0, s: '🌑' }, // New Moon
{ t: 0.25, s: '🌓' }, // First Quarter
{ t: 0.5, s: '🌕' }, // Full Moon
- { t: 0.75, s: '🌗' } // Last Quarter
+ { t: 0.75, s: '🌗' }, // Last Quarter
]
// threshold in days from exact phase to still count for this date
const thresholdDays = 0.5 // ±12 hours
@@ -165,5 +178,5 @@ export {
getLocalizedWeekdayNames,
getLocalizedMonthName,
formatDateRange,
- lunarPhaseSymbol
+ lunarPhaseSymbol,
}