Mauro
Mauro

Reputation: 237

Current date on date picker in vuejs


I am trying to use the component vuejs-datapicker and I would like to highlight the current day on opening the component. I am training using this codesandbox: https://codesandbox.io/s/mpklq49wp

To sum up:

  1. I am looking for something similar to what happens here (bootstrap date picker current date not highlighting) but using vuejs.
  2. How to also choose the color of this date independently of the selected day.

As I am a beginner in vuejs I don't know how to do it.
Thanks,

Upvotes: 0

Views: 3794

Answers (1)

Grumaks
Grumaks

Reputation: 159

Maybe this will be helpful https://www.npmjs.com/package/vuejs-datepicker#highlighted-dates

For example, you can use dates array with single value = current date

const highlighted = {
    dates: [
      // your date
      new Date(2016, 9, 18)
    ]
}
<datepicker :highlighted="highlighted"></datepicker>

Upvotes: 1

Related Questions