ionic datetime picker with time code example

Example 1: ionic datetime


  MMMM
  



  MM DD YY
  



  YYYY
  



  MMMM YY
  



  MM/DD/YYYY
  



  MM/DD/YYYY
  

Example 2: Datepicker ionic

import { DatePicker } from '@ionic-native/date-picker/ngx';

constructor(private datePicker: DatePicker) { }


...


this.datePicker.show({
  date: new Date(),
  mode: 'date',
  androidTheme: this.datePicker.ANDROID_THEMES.THEME_HOLO_DARK
}).then(
  date => console.log('Got date: ', date),
  err => console.log('Error occurred while getting date: ', err)
);

Tags:

Misc Example