Skip to main content

markers

Description

highlights a specified date range in RangeCalendar

Type

function

Example

<script>
const markLine = v =>
v >= new Date(2022, 3, 13) && v <= new Date(2022, 4, 19)
? "inrange"
: "";
</script>

<RangeCalendar current={new Date(2022, 3, 18)} markers={markLine} />

Details

The function passed as a value of the markers property takes one parameter:

  • dateRange - a range of dates to be marked

and must return a string with the name of the CSS class or an empty string.

The current property is used to open the calendars at the view that makes the date range visible.

Related article: Highlighting a date range