All Projects → danielmoncada → date-time-picker

danielmoncada / date-time-picker

Licence: MIT License
Angular Date Time Picker (Responsive Design)

Programming Languages

typescript
32286 projects
HTML
75241 projects
SCSS
7915 projects

Projects that are alternatives of or similar to date-time-picker

react-calendar-datetime-picker
A simple and fast date and time picker component for React
Stars: ✭ 58 (-40.82%)
Mutual labels:  timepicker, datepicker
vue3-date-time-picker
Datepicker component for Vue 3
Stars: ✭ 157 (+60.2%)
Mutual labels:  timepicker, datepicker
ng-persian-datepicker
Persian datepicker for angular 12+
Stars: ✭ 62 (-36.73%)
Mutual labels:  timepicker, datepicker
Material Ui Pickers
Date & Time pickers, built with ❤️ for @material-ui/core
Stars: ✭ 2,291 (+2237.76%)
Mutual labels:  timepicker, datepicker
popoPicker
popoPicker是一个移动端3D滚轮日期时间和单项的选择器,支持无限循环滚动,不依赖第三方库
Stars: ✭ 26 (-73.47%)
Mutual labels:  timepicker, datepicker
Flatpickr
lightweight, powerful javascript datetimepicker with no dependencies
Stars: ✭ 14,575 (+14772.45%)
Mutual labels:  timepicker, datepicker
WheelPicker
A wheel picker for Android, support DateWheelPicker, TimeWheelPicker(滚轮控件,日期、时间选择器,省市区三级联动)
Stars: ✭ 33 (-66.33%)
Mutual labels:  timepicker, datepicker
Ng2 Datetime
Datetime picker plugins wrapper for Angular2+
Stars: ✭ 165 (+68.37%)
Mutual labels:  timepicker, datepicker
s-date-range-picker
📅 A date range picker built with Svelte
Stars: ✭ 13 (-86.73%)
Mutual labels:  datepicker, date-time-picker
silverware-calendar
SilverWare Calendar Module
Stars: ✭ 15 (-84.69%)
Mutual labels:  timepicker, datepicker
Android Pickerview
This is a picker view for android , support linkage effect, timepicker and optionspicker.(时间选择器、省市区三级联动)
Stars: ✭ 13,003 (+13168.37%)
Mutual labels:  timepicker, datepicker
svelty-picker
Simple date & time picker in svelte
Stars: ✭ 38 (-61.22%)
Mutual labels:  timepicker, datepicker
React Native Paper Dates
Smooth and fast cross platform Material Design date and time picker for React Native Paper
Stars: ✭ 173 (+76.53%)
Mutual labels:  timepicker, datepicker
nativescript-datetimepicker
Plugin with date and time picking fields
Stars: ✭ 26 (-73.47%)
Mutual labels:  timepicker, datepicker
React Datepicker
📅 React DatePicker Library (Flexible, Reusable)
Stars: ✭ 165 (+68.37%)
Mutual labels:  timepicker, datepicker
NodaTimePicker
A Date/Time picker component library for Blazor using NodaTime
Stars: ✭ 49 (-50%)
Mutual labels:  timepicker, datepicker
Hibiscus.js
Native Angular directives for Bootstrap4
Stars: ✭ 115 (+17.35%)
Mutual labels:  timepicker, datepicker
React Numpad
A numpad for number, date and time, built with and for React.
Stars: ✭ 117 (+19.39%)
Mutual labels:  timepicker, datepicker
flatpickr-rails
This gem packages flatpickr's assets for drop-in use in Rails applications.
Stars: ✭ 29 (-70.41%)
Mutual labels:  timepicker, datepicker
qing
🍧一个UI组件库。包括 { 日期选择器组件 } { 时间选择器组件 } { 分页组件 } { 树组件 } { 级联选择器组件 } { 表单组件 } 等,ES6语法编写,原生模块化
Stars: ✭ 71 (-27.55%)
Mutual labels:  timepicker, datepicker

📅 🕐 Angular Date/Time Picker

npm npm

** This package supports Angular 9/10/11/12/13*

Breaking Changes

  • Version 13.1.0+ no longer supports the MomentJs time adapter natively. If you want to use the MomentJs adapter, see GitHub or npm.
  • The date/time picker has been updated to support Angular 9-13, as well as compilation using Ivy.
  • If you need Ng8 support, please stick with: https://github.com/DanielYKPan/date-time-picker

Description

Simple Angular date time picker. Online doc is here, Online demos(StackBlitz) are here and here. This picker is responsive design, so feel free to try it in your desktops, tablets and mobile devices.

How to Use

  1. Install with npm: npm install @danielmoncada/angular-datetime-picker --save
  2. Add styles. If you are using Angular CLI, you can add this to your styles.css:
    @import "~@danielmoncada/angular-datetime-picker/assets/style/picker.min.css";
    If you are not using the Angular CLI, you can include the picker.min.css via a <link> element in your index.html.
  3. Add OwlDateTimeModule and OwlNativeDateTimeModule to your @NgModule like example below
     import { NgModule } from '@angular/core';
     import { BrowserModule } from '@angular/platform-browser';
     import { MyTestApp } from './my-test-app';
     import { OwlDateTimeModule, OwlNativeDateTimeModule } from '@danielmoncada/angular-datetime-picker';
    
     @NgModule({
         imports: [
             BrowserModule,
             OwlDateTimeModule,
             OwlNativeDateTimeModule,
         ],
         declarations: [ MyTestApp ],
         bootstrap:    [ MyTestApp ]
     })
     export class MyTestAppModule {}
  4. Connecting a picker to an input and a trigger.
    <input [owlDateTime]="dt1" [owlDateTimeTrigger]="dt1" placeholder="Date Time">
    <owl-date-time #dt1></owl-date-time>
    <input [owlDateTime]="dt2" placeholder="Date Time">
    <span [owlDateTimeTrigger]="dt2"><i class="fa fa-calendar"></i></span>
    <owl-date-time #dt2></owl-date-time>
    The examples above are quite basic. The picker has much more features, and you could learn more about those from demo page.

Animation

This picker uses angular animations to improve the user experience, therefore you need to install @angular/animations and import BrowserAnimationsModule to your application.

npm install @angular/animations --save
import {BrowserModule} from '@angular/platform-browser';
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';

@NgModule({
    imports: [
        BrowserModule,
        BrowserAnimationsModule,
        //...
    ],
    //...
})
export class YourAppModule { }

If you prefer to disable animation effect, use NoopAnimationsModule instead.

Choose a date implementation

The date-time picker was built to be date implementation agnostic. Developers need to make sure to provide the appropriate pieces for the picker to work with their chosen implementation. There are two pre-made modules, users need to import one of them or build your own one (learn more about this from here).

  • OwlNativeDateTimeModule - support for native JavaScript Date object
  • OwlUnixTimestampDateTimeModule - support for milliseconds since Epoch (number)
Date/Time Adapter Extensions

https://day.js.org/

  • OwlDayJsDateTimeModule - support for DayJs
    • You must install an optional adapater to use this. see here, npm

https://momentjs.com/

  • OwlMomentDateTimeModule - support for MomentJs
    • You must install an optional adapater to use this. see here, npm

Properties for owl-date-time

Name Type Required Default Description
pickerType both, calendar, timer Optional both Set the type of the dateTime picker. both: show both calendar and timer, calendar: only show calendar, timer: only show timer.
pickerMode popup, dialog Optional popup The style the picker would open as.
startView month, year, multi-year Optional month The view that the calendar should start in.
yearOnly boolean Optional false Restricts the calendar to only show the year and multi-year views for month selection.
multiyearOnly boolean Optional false Restricts the calendar to only show the multi-year view for year selection.
startAt T/null Optional null The moment to open the picker to initially.
endAt T/null Optional null The the default selected time for range calendar end time
firstDayOfWeek number Optional 0 Set the first day of week. Valid value is from 0 to 6. 0: Sunday - 6: Saturday
showSecondsTimer boolean Optional false When specify it to true, it would show a timer to configure the second's value
hideOtherMonths boolean Optional false Whether to hide dates in other months at the start or end of the current month
hour12Timer boolean Optional false When specify it to true, the timer would be in hour12 format mode
stepHour number Optional 1 Hours to change per step.
stepMinute number Optional 1 Minutes to change per step.
stepSecond number Optional 1 Seconds to change per step.
scrollStrategy ScrollStrategy Optional BlockScrollStrategy Define the scroll strategy when the picker is open. Learn more this from https://material.angular.io/cdk/overlay/overview#scroll-strategies.
disabled boolean Optional false When specify to true, it would disable the picker.
backdropClass string/string[] Optional null Custom class for the picker backdrop.
panelClass string/string[] Optional null Custom class for the picker overlay panel.

Events for owl-date-time

Events Parameter Description
afterPickerOpen null Callback to invoke when the picker is opened
afterPickerClosed null Callback to invoke when the picker is closed.
yearSelected T Callback to invoke when the year is selected.This doesn't imply a change on the selected date.
monthSelected T Callback to invoke when the month is selected.This doesn't imply a change on the selected date.
dateClicked T Callback when the selected data changes.
selectedChanged T Callback when the currently selected data changes.
userSelection null Callback when any date is selected.

Properties for input[owlDateTime]

Name Type Required Default Description
owlDateTime OwlDateTimeComponent<T> Require null The date time picker that this input is associated with.
owlDateTimeFilter ( date: T)=>boolean Optional null A function to filter date time.
disabled boolean Optional false When specify to true, it would disable the picker's input.
min <T> Optional null The minimum valid date time.
max <T> Optional null The maximum valid date time.
selectMode single, range, rangeFrom, rangeTo Optional single Specify the picker's select mode. single: a single value allowed, range: allow users to select a range of date-time, rangeFrom: the input would only show the 'from' value and the picker could only selects 'from' value, rangeTo: the input would only show the 'to' value and the picker could only selects 'to' value.
rangeSeparator string Optional - The character to separate the 'from' and 'to' in input value in range selectMode.

Events for input[owlDateTime]

Events Parameter Description
dateTimeChange source: OwlDateTimeInput, value: input value, input: the input element Callback to invoke when change event is fired on this <input [owlDateTime]>
dateTimeInput source: OwlDateTimeInput, value: input value, input: the input element Callback to invoke when an input event is fired on this <input [owlDateTime]>.

Properties for [owlDateTimeTrigger]

Name Type Required Default Description
owlDateTimeTrigger OwlDateTimeComponent<T> Require null The date time picker that this trigger is associated with.
disabled boolean Optional false When specify to true, it would disable the trigger.

Properties for [owlDateTimeTrigger]

Name Type Required Default Description
owlDateTimeTrigger OwlDateTimeComponent<T> Require null The date time picker that this trigger is associated with.
disabled boolean Optional false When specify to true, it would disable the trigger.

Properties for owl-date-time-inline

Name Type Required Default Description
pickerType both, calendar, timer Optional both Set the type of the dateTime picker. both: show both calendar and timer, calendar: only show calendar, timer: only show timer.
startView month, year, multi-year Optional month The view that the calendar should start in.
startAt T/null Optional null The moment to open the picker to initially.
endAt T/null Optional null The the default selected time for range calendar end time
firstDayOfWeek number Optional 0 Set the first day of week. Valid value is from 0 to 6. 0: Sunday - 6: Saturday
showSecondsTimer boolean Optional false When specify it to true, it would show a timer to configure the second's value
hideOtherMonths boolean Optional false Whether to hide dates in other months at the start or end of the current month
hour12Timer boolean Optional false When specify it to true, the timer would be in hour12 format mode
stepHour number Optional 1 Hours to change per step.
stepMinute number Optional 1 Minutes to change per step.
stepSecond number Optional 1 Seconds to change per step.
disabled boolean Optional false When specify to true, it would disable the picker.
owlDateTimeFilter ( date: T)=>boolean Optional null A function to filter date time.
min <T> Optional null The minimum valid date time.
max <T> Optional null The maximum valid date time.
selectMode single, range, rangeFrom, rangeTo Optional single Specify the picker's select mode. single: a single value allowed, range: allow users to select a range of date-time, rangeFrom: the input would only show the 'from' value and the picker could only selects 'from' value, rangeTo: the input would only show the 'to' value and the picker could only selects 'to' value.

Localization and DateTime Format

Localization for different languages and formats is defined by OWL_DATE_TIME_LOCALE and OWL_DATE_TIME_FORMATS. You could learn more about this from here.

Dependencies

none

Demo

  • Online doc is here
  • Online demos (StackBlitz) are here and here

License

  • License: MIT

Author

Maintained and updated by Daniel Moncada, original implementatiom by Daniel Pan

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].