Giter VIP home page Giter VIP logo

date-time-picker-moment-adapter's Introduction

Angular Date Time Picker (MomentJs Adapter)

npm npm

Angular date time picker - MomentJs Adpater

** This package supports Angular 17 **

Breaking Changes

  • Version 4.x.x >= no longer supports ng 16 - 13. If you need ng 16-13 support, stick with version 3.x.x.
  • Version 2.x.x no longer supports <= ng 13. If you need View Engine support, stick with version 1.x.x.

Description

This is a MomentJs adapter to be used with the following date time picker control:

https://github.com/danielmoncada/date-time-picker

How to Use

  1. Install with npm:npm install @danielmoncada/angular-datetime-picker-moment-adapter --save
  2. import { NgModule } from '@angular/core';
    import { OwlDateTimeModule, OWL_DATE_TIME_FORMATS} from '@danielmoncada/angular-datetime-picker;
    import { OwlMomentDateTimeModule } from '@danielmoncada/angular-datetime-picker-moment-adapter';
    
    // See the Moment.js docs for the meaning of these formats:
    // https://momentjs.com/docs/#/displaying/format/
    export const MY_MOMENT_FORMATS = {
        parseInput: 'l LT',
        fullPickerInput: 'l LT',
        datePickerInput: 'l',
        timePickerInput: 'LT',
        monthYearLabel: 'MMM YYYY',
        dateA11yLabel: 'LL',
        monthYearA11yLabel: 'MMMM YYYY',
    };
    
    @NgModule({
        imports: [OwlDateTimeModule, OwlMomentDateTimeModule],
        providers: [
            {provide: OWL_DATE_TIME_FORMATS, useValue: MY_MOMENT_FORMATS},
        ],
    })
    export class AppExampleModule {
    }

Dependencies

  • moment
  • @danielmoncada/angular-datetime-picker
  • tslib

Demo

License

  • License: MIT

Author

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

date-time-picker-moment-adapter's People

Contributors

danielmoncada avatar pavlikxor avatar poferro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

date-time-picker-moment-adapter's Issues

Focus Issue when used in Modal popup

i'm using the version 16.1.0 , so i have a form in modal popup and when used the date time picker in modal popup i'm not able to input the time, the focus is not being set to the time input and when click on it it always set focus on the first input field in modal popup.
i can only set the time by clicking on the arrows

Upgrade for angular 17 and dependency review

Hi :),

Is it possible to upgrade the dependencies to support angular 17?
In the meantime this module has dependencies declared for @angular/common and @angular/core and @angular/cdk are these necessary? The only explicit dependency I see in code is of @angular/core. Am I missing something?

Thanks and congrats for keeping this nice component alive :).
POFerro

Validation is to fast.

TimepickerValidationStartTimepickerValidation

Hi Daniel Moncada,
I have a validation bug, as seen in the screenshot; when the end time is lower than the start time, the validation instantly changes the start time to the end time input. For instance I have 11:15 as start time and want to type with keyboard 15:15 for end time, the start time jumps to 01 because the "1" of "15" is lower than 11.

I think in the past with angular 7 I didn't have this issue, but when I have upgraded to angular 12 this happens. How can I delay the input validation? Or how can I solve this issue?

I'm using the current packages:
@angular/animations": "~12.2.14",
"@angular/cdk": "^12.2.13",
"@danielmoncada/angular-datetime-picker": "^13.1.1",
"@danielmoncada/angular-datetime-picker-moment-adapter": "^1.1.0",

code:
<owl-date-time
#dtPickerRef
[pickerType]="'timer'"
[hour12Timer] = false
[stepMinute]="15"

Add OWL_MOMENT_DATE_TIME_ADAPTER_OPTIONS to public_api

Can we add OWL_MOMENT_DATE_TIME_ADAPTER_OPTIONS injection token to the list of exports in public_api? Currently there doesn't seem to be a way for me to import the injection token so I can set the useUtc option for the adapter.

Cannot read properties of null reading clampDate at set pickerMoment [as pickerMoment]

Hi,

Error message:
Cannot read properties of null reading clampDate at set pickerMoment [as pickerMoment]

This issue raised on Angular 16 standalone dialog form component for Full-calendar implementation.

Here is the component decorator:

@component({
selector: 'app-form-dialog:not(o)',
templateUrl: './form-dialog.component.html',
standalone: true,
imports: [ CommonModule, ReactiveFormsModule, MatFormFieldModule, MatInputModule, MatSelectModule, MatIconModule, OwlDateTimeModule, OwlNativeDateTimeModule ],
providers: [CalendarService]
})

Some used packages versions:

"@angular/animations": "16.0.3",
"@angular/cdk": "16.0.2",
"@angular/common": "16.0.3",
"@angular/compiler": "16.0.3",
"@angular/core": "16.0.3",
"@angular/flex-layout": "15.0.0-beta.42",
"@angular/forms": "16.0.3",
"@angular/material": "16.0.2",
"@angular/material-luxon-adapter": "16.0.2",
"@angular/platform-browser": "16.0.3",
"@angular/platform-browser-dynamic": "16.0.3",
"@angular/router": "16.0.3",

"@danielmoncada/angular-datetime-picker": "^16.0.1",
"@fullcalendar/angular": "^6.1.9",
"@fullcalendar/core": "^6.1.9",
"@fullcalendar/daygrid": "^6.1.9",
"@fullcalendar/interaction": "^6.1.9",
"@fullcalendar/list": "^6.1.9",
"@fullcalendar/timegrid": "^6.1.9",

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.