Angular datetime picker?

18,944

Solution 1

Try Calendar control from primeNG. This gives you any format of date & time.

Sample implementation looks like below-

Update package.json

"primeng": "^1.0.0-beta.7", "primeui": "^4.1.10",

component lines are-

import { Calendar } from 'primeng/primeng';
directives: [Calendar]

p-calendar [(ngModel)]="date1" dateFormat="mm/dd/yy" timeFormat="HH:mm">

You can find more format examples on - http://www.primefaces.org/primeng/#/calendar

Solution 2

Not sure if this helps, but i have made a basic popup component using the ngx-bootstrap datepicker and timepicker. You can find it here

https://github.com/Gillardo/ngx-bootstrap-datetime-popup

Share:
18,944

Related videos on Youtube

developer747
Author by

developer747

"Abstractions save us time working, but they don't save us time learning."-Joel Spolsky

Updated on September 14, 2022

Comments

  • developer747
    developer747 over 1 year

    I can find plenty of datetime pickers for AngularJS but no reliable (working) ones for Angular. Is there any Angular datetime picker that works, that someone here has used?

  • developer747
    developer747 almost 8 years
    Ive already tried both. If you get their source code from github as is and try npm install and npm run, neither one works. mydatepicker fails in npm run and ng2-datepicker throws a javascrippt error and fails.
  • miquelarranz
    miquelarranz almost 8 years
    It's difficult to find libraries working since Angular 2 is still under development. If you use Chrome and an input of type date, a calendar button is shown and it works like datepicker, but only works on Chrome I guess.
  • Phoenix Dev
    Phoenix Dev almost 7 years
    Is it free to use in production?
  • Sanket
    Sanket almost 7 years
    All PrimeNG widgets are open source and free to use under MIT License.
  • Phoenix Dev
    Phoenix Dev almost 7 years
    Ok thanks! I updated the package json and on running npm update it gave an error like: npm ERR! shasum check failed for /tmp/npm-4892-b82ffbcf/registry.npmjs.org/primeui/-/primeui-‌​4.1.15.tgz.
  • Sanket
    Sanket almost 7 years
    Can you please raise a new question with all your details?
  • Phoenix Dev
    Phoenix Dev almost 7 years
    Ok sure! I'll do it.
  • Phoenix Dev
    Phoenix Dev almost 7 years
    I got it to work but design is broken. Can you help! I have raised a question: stackoverflow.com/questions/44536981/…
  • Aravindh Gopi
    Aravindh Gopi over 6 years
    can you please add a demo?
  • Gillardo
    Gillardo over 6 years
    This has been updated today and working on ng-cli, webpack etc with angular 4+