To set up a configuration object in your component.ts file, you can define it like this:
constructor() {}
config = {
firstDayOfWeek: 'su',
monthFormat: 'MMM, YYYY',
disableKeypress: false,
allowMultiSelect: false,
closeOnSelect: undefined,
closeOnSelectDelay: 100,
onOpenDelay: 0,
weekDayFormat: 'ddd',
appendTo: document.body,
drops: 'down',
opens: 'right',
showNearMonthDays: true,
showWeekNumbers: false,
enableMonthSelector: true,
format: "YYYY-MM-DD HH:mm",
yearFormat: 'YYYY',
showGoToCurrent: true,
dayBtnFormat: 'DD',
monthBtnFormat: 'MMM',
hours12Format: 'hh',
hours24Format: 'HH',
meridiemFormat: 'A',
minutesFormat: 'mm',
minutesInterval: 1,
secondsFormat: 'ss',
secondsInterval: 1,
showSeconds: false,
showTwentyFourHours: true,
timeSeparator: ':',
multipleYearsNavigateBy: 10,
showMultipleYearsNavigation: false,
locale: 'zh-cn',
// min:'2017-08-29 15:50',
// minTime:'2017-08-29 15:50'
};
In your component's HTML, you can reference the config object like this:
<dp-date-picker theme="dp-material" [(ngModel)]="value" mode='daytime' [config]='config'
(ngModelChange)="validatorsChanged()"
[placeholder]="placeholder" [mode]='mode' #datePicker>
</dp-date-picker>