Compare commits

..

2 commits

Author SHA1 Message Date
advplyr
2b7268c952
Merge pull request #4240 from josh-vin/feat/defaultYearInReview
Some checks failed
CodeQL / Analyze (push) Has been cancelled
Run Component Tests / Run Component Tests (push) Has been cancelled
Build and Push Docker Image / build (push) Has been cancelled
Integration Test / build and test (push) Has been cancelled
Run Unit Tests / Run Unit Tests (push) Has been cancelled
Improves Year in Review display logic
2025-04-30 17:26:00 -05:00
Josh Vincent
58cd751b43 Improves Year in Review display logic 2025-04-28 21:00:22 -06:00

View file

@ -164,14 +164,15 @@ export default {
beforeMount() {
this.yearInReviewYear = new Date().getFullYear()
// When not December show previous year
if (new Date().getMonth() < 11) {
this.availableYears = this.getAvailableYears()
const availableYearValues = this.availableYears.map((y) => y.value)
// When not December show previous year if data is available
if (new Date().getMonth() < 11 && availableYearValues.includes(this.yearInReviewYear - 1)) {
this.yearInReviewYear--
}
},
mounted() {
this.availableYears = this.getAvailableYears()
if (typeof navigator.share !== 'undefined' && navigator.share) {
this.showShareButton = true
} else {