fix: use date-fns for gantt years (#734)
Co-authored-by: kolaente <k@knt.li> Reviewed-on: https://kolaente.dev/vikunja/frontend/pulls/734 Co-authored-by: konrad <k@knt.li> Co-committed-by: konrad <k@knt.li>
This commit is contained in:
parent
dae441a373
commit
077fe264f0
1 changed files with 5 additions and 4 deletions
|
@ -24,10 +24,7 @@
|
||||||
class="month"
|
class="month"
|
||||||
v-for="(m, mk) in days[yk]"
|
v-for="(m, mk) in days[yk]"
|
||||||
>
|
>
|
||||||
{{
|
{{ formatYear(new Date(`${yk}-${parseInt(mk) + 1}-01`)) }}
|
||||||
new Date(new Date(`${yk}-${parseInt(mk) + 1}-01`)).toLocaleString('en-us', {month: 'long'})
|
|
||||||
}},
|
|
||||||
{{ new Date(yk).getFullYear() }}
|
|
||||||
<div class="days">
|
<div class="days">
|
||||||
<div
|
<div
|
||||||
:class="{ today: d.toDateString() === now.toDateString() }"
|
:class="{ today: d.toDateString() === now.toDateString() }"
|
||||||
|
@ -197,6 +194,7 @@ import TaskCollectionService from '../../services/taskCollection'
|
||||||
import {mapState} from 'vuex'
|
import {mapState} from 'vuex'
|
||||||
import Rights from '../../models/rights.json'
|
import Rights from '../../models/rights.json'
|
||||||
import FilterPopup from '@/components/list/partials/filter-popup.vue'
|
import FilterPopup from '@/components/list/partials/filter-popup.vue'
|
||||||
|
import {format} from 'date-fns'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'GanttChart',
|
name: 'GanttChart',
|
||||||
|
@ -481,6 +479,9 @@ export default {
|
||||||
this.error(e)
|
this.error(e)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
formatYear(date) {
|
||||||
|
return format(date, 'MMMM, yyyy')
|
||||||
|
},
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
Loading…
Reference in a new issue