From 73a11d5fc757ffaf424aacd59a02856d28bd148d Mon Sep 17 00:00:00 2001 From: Leonid Cupikov Date: Wed, 19 Sep 2018 05:04:54 +0300 Subject: [PATCH 1/2] Add missing second parameter for setMoment --- types/pikaday/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/pikaday/index.d.ts b/types/pikaday/index.d.ts index 9dc370054f..883473e07e 100644 --- a/types/pikaday/index.d.ts +++ b/types/pikaday/index.d.ts @@ -54,7 +54,7 @@ declare class Pikaday { /** * Set the current selection with a Moment.js object (see setDate). */ - setMoment(moment: any): void; + setMoment(moment: any, preventOnSelect?: boolean): void; /** * Change the current view to see a specific date. From 062f45e352dedd3d8c74a6591248f5abce13a32c Mon Sep 17 00:00:00 2001 From: Leonid Cupikov Date: Wed, 19 Sep 2018 13:21:09 +0300 Subject: [PATCH 2/2] Test for setMoment with preventOnSelect parameter --- types/pikaday/pikaday-tests.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/types/pikaday/pikaday-tests.ts b/types/pikaday/pikaday-tests.ts index e61cb635e3..c1be63f5b4 100644 --- a/types/pikaday/pikaday-tests.ts +++ b/types/pikaday/pikaday-tests.ts @@ -32,6 +32,7 @@ new Pikaday({field: $('#datepicker')[0]}); picker.setDate('2015-01-01'); picker.getMoment(); picker.setMoment(moment('14th February 2014', 'DDo MMMM YYYY')); + picker.setMoment(moment('14th February 2014', 'DDo MMMM YYYY'), true); picker.gotoDate(new Date(2014, 1)); picker.gotoToday(); picker.gotoMonth(2);