Ionic date picker customization

Hi,

I am working on an application, where I want to set a date. I am using ionic date picker to show date dialog.

My query is when I scroll the date past maximum date for that month then it jumps to next month, but I want to keep month as it is unless user changes otherwise only the date should keep on rolling back to 1st.

As per attached screenshot, when I change the date from 31 to 1 then Month gets changed to Feb, but I want month to be Jan only.

My code snippet,

showNativeDatePicker() {

    this.beforeClick.emit();

    this.datePicker.show({

      date: this.value ? new Date(this.value) : new Date(),

      mode: 'date',

      androidTheme: this.datePicker.ANDROID_THEMES.THEME_HOLO_LIGHT,

      minDate: new Date(this.minDate).getTime() || '',

      maxDate: new Date(this.maxDate).getTime() || '',

      allowOldDates: false

    }).then(

      (date: Date) => {

        const d = this.datePipe.transform(date, 'yyyy-MM-dd');

        this.value = d;

        this.onClick.emit(d);

      },

      err => console.log(err)

    );

  }

Any suggestions/pointers will be much appreciated.

You could extend the component class and overide that functions logic however that is not recommended as Ionic has done lots of testing on this component.


You could customize cordova plugin (java source) in Android-Studio like this.
This is not perfect sources but I think you could finalize it with this.