A Flutter date and time picker widget with Mongolian language support, built with ClojureDart.
- 🗓️ Date Picker: Select year, month, and day with vertical scrolling wheels
- ⏰ Time Picker: Select hour and minute
- 📅 DateTime Picker: Combined date and time picker with mode switching
- 🇲🇳 Mongolian Language Support: Full support for Mongolian text and numerals
- 🎨 Customizable: Configurable options for styling and behavior
- 📱 Modal Bottom Sheet: Easy-to-use modal picker dialog
- 🔄 Smart Date Validation: Automatically handles month-end dates (e.g., Feb 30 → Feb 28/29)
A date picker widget that displays year, month, and day in vertical scrolling wheels.
Parameters:
initial-date(optional): InitialDateTimevalueon-changed(optional): Callback function that receives the selectedDateTimeoptions(optional): Custom styling and behavior options
A time picker widget that displays hour and minute in vertical scrolling wheels.
Parameters:
initial-date(optional): InitialDateTimevalue (only hour and minute are used)on-changed(optional): Callback function that receives the selectedDateTimeoptions(optional): Custom styling and behavior options
A combined date and time picker with mode switching capability.
Parameters:
initial-date(optional): InitialDateTimevalueon-changed(optional): Callback function that receives the selectedDateTimeoptions(optional): Custom styling and behavior options
Displays a modal bottom sheet with date/time picker.
Parameters:
ctx: Build contexton-confirm: Callback function that receives the confirmedDateTimeinitial-date(optional): InitialDateTimevalueshow-date(optional, default:true): Whether to show date pickershow-time(optional, default:true): Whether to show time pickershow-handle?(optional, default:true): Whether to show the drag handle at the top of the modaloptions(optional): Custom styling and behavior options
The picker supports various customization options:
{:item-extent 45.0 ; Height of each item in the wheel
:diameter-ratio 1.3 ; Diameter ratio for the wheel
:perspective 0.008 ; Perspective value for 3D effect
:magnification 1.15 ; Magnification for selected item
:use-haptics true ; Enable haptic feedback on scroll
:digit-type :arabic ; :arabic or :mongol for number display
:text-style TextStyle ; Text styling for items
:selected-color Color ; Background color for selected item
:item-height 80.0 ; Container height for each wheel
}- Flutter SDK
- mongol package (^9.0.0) - For Mongolian text rendering
- ClojureDart - For Clojure-to-Dart compilation
- Flutter SDK installed
- Clojure CLI tools installed
- ClojureDart setup
- Clone this repository
- Add the package to your
pubspec.yaml(if published) or use it as a local dependency
- Install the clj command (if not already installed)
- Initialize the example:
clj -M:cljd init - Open a simulator:
open -a Simulator - Run Flutter:
clj -M:cljd flutter
(ns my-app.main
(:require ["package:flutter/material.dart" :as m]
[cljd.flutter :as f]
[mongol-date-picker.picker :as picker]))
(defn main []
(m/runApp
(m/MaterialApp
.home (f/widget
:context ctx
:managed [selected-date (atom nil)]
(m/Scaffold
.body (m/Center
.child (m/Column
.children
[(m/Text (if @selected-date
(str "Selected: " @selected-date)
"No date selected"))
(m/ElevatedButton
.onPressed (fn []
(picker/show-picker ctx
(fn [date]
(reset! selected-date date))
:initial-date @selected-date))
.child (m/Text "Select Date & Time"))]))))))The date picker supports a range of 200 years (100 years before and 100 years after the initial date).
MIT License
