mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2025-01-26 00:14:49 +01:00
Use Date-Fns locale to generate month and day labels
This commit is contained in:
parent
e8d582269b
commit
41db0e3bb1
@ -108,7 +108,7 @@ export default {
|
|||||||
var _date = this.$addDaysToToday(i * -1)
|
var _date = this.$addDaysToToday(i * -1)
|
||||||
days.push({
|
days.push({
|
||||||
dayOfWeek: this.$formatJsDate(_date, 'EEEE'),
|
dayOfWeek: this.$formatJsDate(_date, 'EEEE'),
|
||||||
dayOfWeekAbbr: this.$strings[`Weekday${this.$formatJsDate(_date, 'EEE')}`],
|
dayOfWeekAbbr: this.$formatJsDate(_date, 'EEE'),
|
||||||
date: this.$formatJsDate(_date, 'yyyy-MM-dd')
|
date: this.$formatJsDate(_date, 'yyyy-MM-dd')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
@ -68,7 +68,7 @@ export default {
|
|||||||
dayLabels() {
|
dayLabels() {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
label: this.$strings.WeekdayMon,
|
label: this.$formatJsDate(new Date(2023, 0, 2), 'EEE'),
|
||||||
style: {
|
style: {
|
||||||
transform: `translate(${-25}px, ${13}px)`,
|
transform: `translate(${-25}px, ${13}px)`,
|
||||||
lineHeight: '10px',
|
lineHeight: '10px',
|
||||||
@ -76,7 +76,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$strings.WeekdayWed,
|
label: this.$formatJsDate(new Date(2023, 0, 4), 'EEE'),
|
||||||
style: {
|
style: {
|
||||||
transform: `translate(${-25}px, ${13 * 3}px)`,
|
transform: `translate(${-25}px, ${13 * 3}px)`,
|
||||||
lineHeight: '10px',
|
lineHeight: '10px',
|
||||||
@ -84,7 +84,7 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
label: this.$strings.WeekdayFri,
|
label: this.$formatJsDate(new Date(2023, 0, 6), 'EEE'),
|
||||||
style: {
|
style: {
|
||||||
transform: `translate(${-25}px, ${13 * 5}px)`,
|
transform: `translate(${-25}px, ${13 * 5}px)`,
|
||||||
lineHeight: '10px',
|
lineHeight: '10px',
|
||||||
@ -208,7 +208,7 @@ export default {
|
|||||||
const date = i === 0 ? this.firstWeekStart : this.$addDaysToDate(this.firstWeekStart, i)
|
const date = i === 0 ? this.firstWeekStart : this.$addDaysToDate(this.firstWeekStart, i)
|
||||||
const dateString = this.$formatJsDate(date, 'yyyy-MM-dd')
|
const dateString = this.$formatJsDate(date, 'yyyy-MM-dd')
|
||||||
const datePretty = this.$formatJsDate(date, 'MMM d, yyyy')
|
const datePretty = this.$formatJsDate(date, 'MMM d, yyyy')
|
||||||
const monthString = this.$strings[`Month${this.$formatJsDate(date, 'MMM')}`]
|
const monthString = this.$formatJsDate(date, 'MMM')
|
||||||
const value = this.daysListening[dateString] || 0
|
const value = this.daysListening[dateString] || 0
|
||||||
const x = col * 13
|
const x = col * 13
|
||||||
const y = row * 13
|
const y = row * 13
|
||||||
|
Loading…
Reference in New Issue
Block a user