How to use the @deja-js/component/date-selector.DateComponentLayout.timeonly function in @deja-js/component

To help you get started, we’ve selected a few @deja-js/component examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DSI-HUG / dejajs-components / src / app / date-picker / date-picker-demo.ts View on Github external
templateUrl: './date-picker-demo.html',
})
export class DejaDatePickerDemoComponent implements OnInit {
    public tabIndex = 1;

    public theDate: Date = new Date();
    public theDateSelected: Date = new Date();

    public disabledDate = [0, 6, new Date(2016, 9, 12)];

    public dateRangeFrom: Date;
    public dateRangeTo: Date;
    public dateMin: Date;
    public dateMax: Date;

    public myLayout = DateComponentLayout.timeonly;

    constructor() {
    }

    public ngOnInit() {
        const now: Date = new Date();
        this.dateMin = new Date(now.getFullYear(), now.getMonth(), now.getDate() - 7);
        this.dateMax = new Date(now.getFullYear(), now.getMonth(), now.getDate());
        this.theDateSelected = new Date(now.getFullYear(), now.getMonth(), now.getDate() - 1);
        console.log(this.dateMin);
        console.log(this.dateMax);
    }

    public dateChange(date: Date) {
        console.log('dateChange', date);
    }