1.1.4 • Published 2 months ago

leaflet-calendar v1.1.4

Weekly downloads
-
License
MIT
Repository
github
Last release
2 months ago

leaflet-calendar

npm

A calendar date picker for Leaflet.

See the demo.

calendar picker opened

Usage

 L.control.calendar({
      id: 1,
      minDate: "2023-04-01",
      maxDate: "2023-04-29",
      onSelectDate: (value) => this.onSelectDate(value),
      position: "topleft",
    }).addTo(this.map);
  }

  onSelectDate(value): void {
    alert("Date: " + value)
  }

The onSelectDate function is your custom function which is triggered everytime the date is changed.

Options

See table below for full description of customizable options for your calendar picker.

OptionDescriptionDefault
idid of calendar picker. It's mandatory when using various calendar pickers on the same map.''
positionPosition of calendar picker ('topleft','topright','bottomleft','bottomright')"bottomright"
minDateMinimum selectable date value in the calendar''
maxDateMaximun selectable date value in the calendar.''
valueInitial date selected (YYYY-MM-DD).Current date
onSelectDateFunction that will execute when a date is selected.function(value) { console.log("The function is mandatory"); }
triggerFunctionOnLoadTrigger onSelectDate function on first loadfalse
nextButtonAdd a next buttontrue
backButtonAdd a back buttontrue
marginLeftLeft margin in pixels of the container"10px"
marginRightRight margin in pixels of the container"10px"
marginTopTop margin in pixels of the container"10px"
marginBottomBottom margin in pixels of the container"10px"

License

This software is released under the MIT licence. Icon used in the example are from https://www.flaticon.com.

1.1.4

2 months ago

1.1.3

10 months ago

1.1.2

10 months ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago