Calendar
An embeddable date picker for single dates, ranges and times. Render it inline, as a popup, or bound to an input. Pick a start and an end date below.
Pick a start and an end date
<html>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@calendarjs/ce/dist/style.min.css" />
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Material+Icons" />
<script src="https://cdn.jsdelivr.net/npm/lemonadejs/dist/lemonade.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@calendarjs/ce/dist/index.min.js"></script>
<div id="root"></div>
<p id="output">Pick a start and an end date</p>
<script>
const { Calendar } = calendarjs;
Calendar(document.getElementById('root'), {
type: 'inline',
range: true,
onchange: function(self, value) {
if (value) {
document.getElementById('output').textContent = value[0] + ' to ' + value[1];
}
}
});
</script>
</html>import { Calendar } from '@calendarjs/ce';
import '@calendarjs/ce/dist/style.css';
Calendar(document.getElementById('root'), {
type: 'inline',
range: true,
onchange: (self, value) => {
if (value) {
document.getElementById('output').textContent = value[0] + ' to ' + value[1];
}
}
});import { useState } from 'react';
import { Calendar } from '@calendarjs/ce/dist/react';
import '@calendarjs/ce/dist/style.css';
export default function App() {
const [range, setRange] = useState(null);
return (<>
<Calendar type="inline" range={true} onchange={(self, value) => setRange(value)} />
<p>{range ? range[0] + ' to ' + range[1] : 'Pick a start and an end date'}</p>
</>);
}<template>
<div>
<Calendar type="inline" :range="true" :onchange="onChange" />
<p>{{ range ? range[0] + ' to ' + range[1] : 'Pick a start and an end date' }}</p>
</div>
</template>
<script>
import { Calendar } from '@calendarjs/ce/dist/vue';
import '@calendarjs/ce/dist/style.css';
export default {
components: { Calendar },
data() {
return { range: null };
},
methods: {
onChange(self, value) {
this.range = value;
}
}
}
</script>Features
Section titled “Features”- Single dates, ranges and times: one component for every date input
- Inline, popup or input-bound: render it where you need it
- Keyboard navigation: arrows, Enter and Escape for fast input
- Validation: restrict selectable dates with
validRange - Formats: display and parse custom date formats
- Internationalization: translated month and weekday names
- Events:
onchange,onupdate,onopenandonclosecallbacks
Use Cases
Section titled “Use Cases”- Hotel and vacation booking
- Checkout and delivery dates
- Report and analytics date filters
- Leave and vacation request forms
- Meeting time pickers