From 2e61cd922a97d2dfebe5ebc73b5ac82ba37a20b7 Mon Sep 17 00:00:00 2001 From: Alexey_Rak Date: Thu, 4 May 2023 22:08:46 +0200 Subject: [PATCH 1/2] Update bs-datepicker-utils.spec.ts Turned on copyTime test --- src/datepicker/testing/bs-datepicker-utils.spec.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/datepicker/testing/bs-datepicker-utils.spec.ts b/src/datepicker/testing/bs-datepicker-utils.spec.ts index 7a08240f36..b56cc73573 100644 --- a/src/datepicker/testing/bs-datepicker-utils.spec.ts +++ b/src/datepicker/testing/bs-datepicker-utils.spec.ts @@ -51,7 +51,7 @@ describe('daterangepicker:', () => { expect(JSON.stringify(valuesResult)).toEqual(JSON.stringify(values)); }); - xit('should update time part of source date', () => { + it('should update time part of source date', () => { const date = new Date(2019, 1, 1, 12, 30, 59, 999); copyTime(date, new Date(2020, 1, 1, 0, 0, 0, 0)); expect(date.getFullYear()).toEqual(2019); From a6bf9fc75107a35d2b5874c2b9564820ebc9a237 Mon Sep 17 00:00:00 2001 From: Alexey_Rak Date: Thu, 4 May 2023 22:10:04 +0200 Subject: [PATCH 2/2] Update copy-time-utils.ts fixed copyTime function --- src/datepicker/utils/copy-time-utils.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/datepicker/utils/copy-time-utils.ts b/src/datepicker/utils/copy-time-utils.ts index b809ec76dc..149705f3b9 100644 --- a/src/datepicker/utils/copy-time-utils.ts +++ b/src/datepicker/utils/copy-time-utils.ts @@ -1,5 +1,5 @@ export function copyTime(sourceDate: Date, time: Date) { - if (!sourceDate || !isNaN(sourceDate.getTime())) { + if (!sourceDate || isNaN(sourceDate.getTime())) { return; }