Skip to content

Instantly share code, notes, and snippets.

View mrtorks's full-sized avatar
💭
I may be slow to respond.

James T mrtorks

💭
I may be slow to respond.
View GitHub Profile
@mrtorks
mrtorks / DateRangePicker.js
Last active April 20, 2026 20:19
Standalone DateRangePicker. Inspired by the abandoned daterangepicker library.
/**
* DateRangePicker — zero-dependency, framework-portable
* Works standalone, with Alpine.js, Vue, React (via ref), Livewire, or any JS env.
*
* Usage (vanilla):
* const picker = new /* The above code is a comment block in JavaScript. It appears to be
documenting or describing a component or feature called "DateRangePicker".
The code is enclosed in triple hash symbols (
* DateRangePicker('#my-input', { ...options });
* picker.on('apply', ({ start, end }) => console.log(start, end));