All Projects → abadi199 → Datetimepicker

abadi199 / Datetimepicker

Licence: apache-2.0
📅 Date and Time Picker

Programming Languages

elm
856 projects

Projects that are alternatives of or similar to Datetimepicker

Ng2 Datetime
Datetime picker plugins wrapper for Angular2+
Stars: ✭ 165 (+83.33%)
Mutual labels:  datepicker, timepicker, datetimepicker
NodaTimePicker
A Date/Time picker component library for Blazor using NodaTime
Stars: ✭ 49 (-45.56%)
Mutual labels:  timepicker, datepicker, datetimepicker
Material Ui Pickers
Date & Time pickers, built with ❤️ for @material-ui/core
Stars: ✭ 2,291 (+2445.56%)
Mutual labels:  datepicker, timepicker, datetimepicker
Datetimepicker
⭐️🎉一个简约、漂亮的日期时间选择器,支持全方位自定义UI
Stars: ✭ 378 (+320%)
Mutual labels:  datepicker, timepicker, datetimepicker
skwas-cordova-plugin-datetimepicker
Cordova Plugin for showing a native date, time or datetime picker.
Stars: ✭ 37 (-58.89%)
Mutual labels:  timepicker, datepicker, datetimepicker
Datetimepicker
This is a custom android holo datepicker timepicker
Stars: ✭ 56 (-37.78%)
Mutual labels:  datepicker, timepicker, datetimepicker
Angular Bootstrap Datetimepicker
Native Angular date/time picker component styled by Twitter Bootstrap
Stars: ✭ 1,289 (+1332.22%)
Mutual labels:  datepicker, timepicker, datetimepicker
Materialdaterangepicker
A material Date Range Picker based on wdullaers MaterialDateTimePicker
Stars: ✭ 1,315 (+1361.11%)
Mutual labels:  datepicker, timepicker, datetimepicker
svelty-picker
Simple date & time picker in svelte
Stars: ✭ 38 (-57.78%)
Mutual labels:  timepicker, datepicker, datetimepicker
popoPicker
popoPicker是一个移动端3D滚轮日期时间和单项的选择器,支持无限循环滚动,不依赖第三方库
Stars: ✭ 26 (-71.11%)
Mutual labels:  timepicker, datepicker, datetimepicker
nativescript-datetimepicker
Plugin with date and time picking fields
Stars: ✭ 26 (-71.11%)
Mutual labels:  timepicker, datepicker, datetimepicker
Datetimepicker
jQuery Plugin Date and Time Picker
Stars: ✭ 3,402 (+3680%)
Mutual labels:  datepicker, timepicker, datetimepicker
vue3-date-time-picker
Datepicker component for Vue 3
Stars: ✭ 157 (+74.44%)
Mutual labels:  timepicker, datepicker, datetimepicker
Pickerjs
⚠️ [Deprecated] No longer maintained. JavaScript date time picker.
Stars: ✭ 299 (+232.22%)
Mutual labels:  datepicker, timepicker, datetimepicker
Vue Datetime
Mobile friendly datetime picker for Vue. Supports date and datetime modes, i18n and more.
Stars: ✭ 928 (+931.11%)
Mutual labels:  datepicker, timepicker, datetimepicker
Angular Datepicker
Highly configurable date picker built for Angular applications
Stars: ✭ 386 (+328.89%)
Mutual labels:  datepicker, timepicker
Jedate
jeDate V6.5.0 是一款原生JS开发的 不依赖任何第三方库 大众化的日期控件,她身兼多职,虽不是万能的,但是她却是功能强大多样的美少女,她除了包含 单双面板、区域选择、 多语言、日历固定、有效无效日期、日期时间戳转换、日期加减、限制时分秒、初始化日期加减N、日期标注点、设定年月(YYYY-MM)、日期范围限制、开始日期设定、自定义日期格式、当天的前后若干天返回、时分秒选择、智能响应、自动纠错、节日识别,操作等常规功能外,根据不同的日期格式,显示不同内容,还拥有更多趋近完美的解决方案。更多的是需要你与她的亲密接触与呵护!
Stars: ✭ 433 (+381.11%)
Mutual labels:  datepicker, datetimepicker
Zebra datepicker
A super-lightweight, highly configurable, cross-browser date / time picker jQuery plugin
Stars: ✭ 367 (+307.78%)
Mutual labels:  datepicker, timepicker
Angular Moment Picker
Angular Moment Picker is an AngularJS directive for date and time picker using Moment.js.
Stars: ✭ 536 (+495.56%)
Mutual labels:  datepicker, timepicker
Androidpicker
安卓选择器类库,包括日期及时间选择器(可用于出生日期、营业时间等)、单项选择器(可用于性别、民族、职业、学历、星座等)、二三级联动选择器(可用于车牌号、基金定投日期等)、城市地址选择器(分省级、地市级及区县级)、数字选择器(可用于年龄、身高、体重、温度等)、日历选日期择器(可用于酒店及机票预定日期)、颜色选择器、文件及目录选择器、图片选择器等……WheelPicker/DatePicker/TimePicker/OptionPicker/NumberPicker/LinkagePicker/AddressPicker/CarPlatePicker/CalendarPicker/ColorPicker/FilePicker/ImagePicker etc.
Stars: ✭ 5,320 (+5811.11%)
Mutual labels:  datepicker, timepicker

Date and Time Picker

Demo

Live Demo

Date Time Picker

The date and time picker can be used in two modes:

  • Analog Time Picker
  • Digital Time Picker

Analog time picker

alt text

Code:

view model =
    DateTimePicker.dateTimePickerWithConfig
        { defaultDateTimeConfig | timePickerType = DateTimePicker.Config.Analog }
        [ class "my-datetimepicker" ]
        model.state
        model.value

Digital time picker

alt text

Code:

view model =
    DateTimePicker.dateTimePickerWithConfig
        { defaultDateTimeConfig | timePickerType = DateTimePicker.Config.Digital }
        [ class "my-datetimepicker" ]
        model.state
        model.value

Date Picker

Just the date picker without the time.

alt text

Code:

type Msg = DateChange DateTimePicker.State (Maybe Date)

type alias Model = { value : Maybe Date, state : DateTimePicker.State }

view model =
    DateTimePicker.datePicker
        DateChange
        [ class "my-datepicker" ]
        model.state
        model.value

Time Picker

Just the time picker without the date.

alt text

Code:

type Msg = TimeChange DateTimePicker.State (Maybe Date)

type alias Model = { value : Maybe Date, state : DateTimePicker.State }

view model =
    DateTimePicker.timePicker
        TimeChange
        [ class "my-timepicker" ]
        model.state
        model.value

Documentation

This package follows the evancz\sortable-table package approach where it's not a nested elm architecture 'component'. It's just view functions where you feed the data and the message constructor to the function. It does use an opaque State to maintain its internal state.

The picker requires the initial value of the date (usually today) to set the initial position of the calendar. To feed this date to the picker's internal state, you can use 2 approaches

  • By passing a Date value to the DateTimePicker.initialStateWithToday function when initialing the picker's State.
  • By calling the DateTimePicker.initialCmd as part of your init commands.

Views

The date time picker package provides multiple view functions, depending on how you want to use the picker.

  • datePicker is a simple date picker view, with no time picker, and comes with all default configuration.
  • timePicker is a simple time picker view, with no date picker, and comes with all default configuration.
  • dateTimePicker is a simple date and time picker view, comes with all default configuration.
  • datePickerWithConfig is a configurable date picker view.
  • timePickerWithConfig is a configurable time picker view.
  • dateTimePickerWithConfig is a configurable date and time picker view.

Config

You customize the date picker configuration by passing a DateTimePicker.Config.Config value to the picker's view function. The DateTimePicker.Config module provides some default configurations for both date picker and date time picker.

Internationalization

In order to localize your date format, you need to provide the date time picker with a Date to String formatter and String to Maybe Date parser. The author recommends using rluiten/elm-date-extra for the formatter, and abadi199/dateparser for the parser.

CSS

The rtfeldman/elm-css code for this package is available as separate package as abadi199/datetimepicker-css, that way, you can still use package without having to have dependency to elm-css or if your project is using different version of elm-css. Just the download compiled styles.css in include it in your html. If you're using elm-css in your project, and you want to bundle the DateTimePicker's css along with our project css, please refer to abadi199/datetimepicker-css

Example

Here's a snippet of typical Elm application:

main =
    Html.program
        { init = init
        , view = view
        , update = update
        , subscriptions = subscriptions
        }

type Msg
    = DateChange DateTimePicker.State (Maybe Date)

type alias Model =
    { selectedDate : Maybe Date
    , datePickerState : DateTimePicker.State
    }

init =
    ( { selectedDate = Nothing, datePickerState = DateTimePicker.initialState }
    , DateTimePicker.initialCmd DateChange DateTimePicker.initialState
    )

view model =
    DateTimePicker.dateTimePickerWithConfig
        DateChange
        [ class "my-datetimepicker" ]
        model.datePickerState
        model.selectedDate

update msg model =
    case msg of
        DateChange datePickerState selectedDate ->
            ( { model | selectedDate = selectedDate, datePickerState = datePickerState }, Cmd.none )

subscriptions =
    ...

For a complete sample code, please see the demo folder of the source code.

Contributing

  • Submit a pull request! If you're missing a feature you want to have, or just found a bug, or found an error in the docs, please submit a pull request.
  • Create an issue! If you found a bug or want a new feature that you think will make the library better, but don't have time to do it yourself, please submit an issue.
  • Message me on slack or twitter if you just want to give me a feedback or thank me. I'm abadi199 on elm-lang slack channel.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].