0

Any ideas to access this Datepicker prop > PickerMonth > pageDate The idea is, I want to get the month name when @changedMonth is triggered.

<datepicker 
  :inline="true" 
  v-model="dateState" 
  :disabledDates="disabledDates"
  :highlighted="highlighted"
  @changedMonth="changedMonth"></datepicker>
changedMonth(value) {
  console.log(Datepicker> PickerMonth> pageDate) //which is Fri Feb 01 2019 00:00:00 GMT+0800 as an example
}
Phil
  • 157,677
  • 23
  • 242
  • 245
  • 1
    instead of using a hacky solution, you would be better off using stable solution like https://github.com/iamkun/dayjs or momentjs, or https://stackoverflow.com/a/1643468/5599288 – Jacob Goh Sep 26 '18 at 03:24
  • Have you tried looking at the `value` passed to your method? Looking at the source code of `vuejs-datepicker`, that should contain information on the selected month – Phil Sep 26 '18 at 03:36
  • @Phil yes you're right –  Sep 26 '18 at 03:39

1 Answers1

1

If you are using this component as a date picker, https://github.com/charliekassel/vuejs-datepicker, then changedMonth event handler will provide your the required changed month as input (Use $event).

Harshal Patil
  • 17,838
  • 14
  • 60
  • 126