简体   繁体   中英

Datepicker with Angular 2 RC1

Is there a datepicker which we can use with Angular 2 RC1

I can see ng2-datepicker is using angular2 RC1 but while installing it's looking for Angular 2 Beta.

Any Help.

Thanks in Advance

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

Sample implementation looks like below-

  1. Update package.json

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

  2. import Calendar from primeNG

    import { Calendar } from 'primeng/primeng';

  3. Declare it in directives

    directives: [Calendar]

  4. Use it in Component template

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

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM