-
+
@@ -20,7 +20,7 @@
import { computed, ComputedRef, defineComponent } from 'vue'
import Timeline from '@/components/Dashboard/Timeline.vue'
- import UserCalendar from '@/components/Dashboard/UserCalendar.vue'
+ import UserCalendar from '@/components/Dashboard/UserCalendar/index.vue'
import UserMonthStats from '@/components/Dashboard/UserMonthStats.vue'
import UserRecords from '@/components/Dashboard/UserRecords.vue'
import UserStats from '@/components/Dashboard/UserStats.vue'
diff --git a/fittrackee_client/tests/unit/utils/dates.spec.ts b/fittrackee_client/tests/unit/utils/dates.spec.ts
index a149212c..114cb13d 100644
--- a/fittrackee_client/tests/unit/utils/dates.spec.ts
+++ b/fittrackee_client/tests/unit/utils/dates.spec.ts
@@ -1,6 +1,6 @@
import { assert, expect } from 'chai'
-import { incrementDate, startDate } from '@/utils/dates'
+import { getCalendarStartAndEnd, incrementDate, startDate } from '@/utils/dates'
describe('startDate (week starting Sunday)', () => {
const testsParams = [
@@ -135,3 +135,23 @@ describe('dateIncrement', () => {
)
})
})
+
+describe('getCalendarStartAndEnd', () => {
+ const testsParams = [
+ {
+ description: 'returns empty string if no date provided',
+ inputDate: 'September 5, 2021 20:00:00',
+ expectedStartDate: 'August 29, 2021 00:00:00',
+ expectedEndDate: 'October 2, 2021 23:59:59.999',
+ },
+ ]
+
+ testsParams.map((testParams) =>
+ it(testParams.description, () => {
+ const date: Date = new Date(testParams.inputDate)
+ const results = getCalendarStartAndEnd(date, false)
+ assert.deepEqual(results.start, new Date(testParams.expectedStartDate))
+ assert.deepEqual(results.end, new Date(testParams.expectedEndDate))
+ })
+ )
+})
diff --git a/fittrackee_client/yarn.lock b/fittrackee_client/yarn.lock
index 03947b89..5d6207cb 100644
--- a/fittrackee_client/yarn.lock
+++ b/fittrackee_client/yarn.lock
@@ -3581,6 +3581,11 @@ data-urls@^1.1.0:
whatwg-mimetype "^2.2.0"
whatwg-url "^7.0.0"
+date-fns-tz@^1.1.6:
+ version "1.1.6"
+ resolved "https://registry.yarnpkg.com/date-fns-tz/-/date-fns-tz-1.1.6.tgz#93cbf354e2aeb2cd312ffa32e462c1943cf20a8e"
+ integrity sha512-nyy+URfFI3KUY7udEJozcoftju+KduaqkVfwyTIE0traBiVye09QnyWKLZK7drRr5h9B7sPJITmQnS3U6YOdQg==
+
date-fns@^2.23.0:
version "2.23.0"
resolved "https://registry.yarnpkg.com/date-fns/-/date-fns-2.23.0.tgz#4e886c941659af0cf7b30fafdd1eaa37e88788a9"