nathanreyes / v-calendar

An elegant calendar and datepicker plugin for Vue.
https://vcalendar.io
MIT License
4.32k stars 840 forks source link

Color-coding for Saturday and Sunday #1439

Open ciwasa opened 4 months ago

ciwasa commented 4 months ago

In v-callender, I am trying to add repeated dates to attributes to make Saturday blue and Sunday red.

ex. Saturday

{
  dates: {
    repeat: {
      every: "weeks",
      weekdays: 7,
    },
  },
  content: {
    style: {
      color: "#3686b2",
    },
  },
},

However, this would result in the error message "A valid "from" date is required for date interval rule. this rule will be skipped ". The display is fine.

color

I tried adding a key "from" to the repeat item and specifying new Date(2000, 0, 1) as the value, to see if that would work as well, The error message is no longer displayed. The expected coloring was not achieved.

I tried changing the date to the most recent new Date(2024, 0, 1) and also specified a key called until, but the result was the same.

dates: {
  repeat: {
    every: "weeks",
    from: new Date(2000, 0, 1),
    weekdays: 7,
  },
},

Currently, I am implementing with REPEATED DATES, although an error is output.

My question is as follows.

HZooly commented 4 months ago

Same here. I can't find any code relating to this error.

hoancmg commented 1 month ago

I think you should try start: new Date(2000, 0, 1) instead of from: new Date(2000, 0, 1).

Docs: https://vcalendar.io/calendar/dates.html#interval-rules