We will be sunsetting Advisor during Jan, 2026 and will instead be providing information in Snyk Security DB.

You can begin to take advantage of Snyk Security DB today for a unified, package-centric experience.

How to use the @fundamental-ngx/core.FdDate.getToday function in @fundamental-ngx/core

To help you get started, we’ve selected a few @fundamental-ngx/core 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 SAP / fundamental-ngx / apps / docs / src / app / core / component-docs / calendar / examples / calendar-single-example.component.ts View on Github external
<br>
        <div>Selected Date: {{date.toDateString()}}</div>
        <button>Disable Wednesday</button>
    `,
    styles: [
        `
            button {
                margin-top: 1rem;
            }
        `
    ]
})
export class CalendarSingleExampleComponent {

    date = FdDate.getToday();

    myDisableFunction = function (d: FdDate): boolean {
        const day = d.getDay();
        return day === 6 || day === 7;
    };

    // Block days before/after any day
    myBlockFunction = function (d: FdDate): boolean {
        const firstDay = FdDate.getToday();
        const lastDay = new FdDate(firstDay.year, firstDay.month, firstDay.day + 7);
        return d.getTimeStamp() &gt; firstDay.getTimeStamp() &amp;&amp; d.getTimeStamp() &lt; lastDay.getTimeStamp();
    };

    disableWednesday() {
        this.myDisableFunction = function (d: FdDate): boolean {
            const day = d.getDay();
github SAP / fundamental-ngx / apps / docs / src / app / core / component-docs / date-picker / examples / date-picker-disabled-example.component.ts View on Github external
import { Component } from '@angular/core';
import { FdDate } from '@fundamental-ngx/core';

@Component({
    selector: 'fd-date-picker-disabled-example',
    template: ` 
            <br>
            <div>Selected Date: {{date ? date.toDateString() : 'null'}}</div>`
})
export class DatePickerDisabledExampleComponent {

    date = FdDate.getToday();

}
github SAP / fundamental-ngx / apps / docs / src / app / core / component-docs / date-picker / examples / date-picker-form-range-example.component.ts View on Github external
Touched: {{customForm.controls.dates.touched}}<br>
        Dirty: {{customForm.controls.dates.dirty}}<br>
        Valid: {{customForm.controls.dates.valid}}<br>

        Range Start Date: {{ customForm.controls.dates.value.start ? customForm.controls.dates.value.start.toDateString() : 'null' }}<br>
        Range End Date: {{ customForm.controls.dates.value.end ? customForm.controls.dates.value.end.toDateString() : 'null' }}
        
    `
})
export class DatePickerFormRangeExampleComponent {

    customForm = new FormGroup({
        dates: new FormControl({
            start: FdDate.getToday(),
            end: FdDate.getToday().nextDay()
        })
    });
}
github SAP / fundamental-ngx / apps / docs / src / app / core / component-docs / date-picker / examples / date-picker-form-example.component.ts View on Github external
Selected Date: {{ customForm.controls.date.value ? customForm.controls.date.value.toDateString() : 'null' }}
            
            <div>
                <br>
                Touched: {{customForm.controls.disabledDate.touched}}<br>
                Dirty: {{customForm.controls.disabledDate.dirty}}<br>
                Valid: {{customForm.controls.disabledDate.valid}}<br>
                Disabled: {{customForm.controls.disabledDate.disabled}} <br>
                Selected Date: {{ customForm.controls.disabledDate.value ? customForm.controls.date.value.toDateString() : 'null' }}
            </div>
        
    `
})
export class DatePickerFormExampleComponent {
    customForm = new FormGroup({
        date: new FormControl(FdDate.getToday()),
        disabledDate: new FormControl({ value: FdDate.getToday(), disabled: true })
    });
}
github SAP / fundamental-ngx / apps / docs / src / app / core / component-docs / date-picker / examples / date-picker-position-example.component.ts View on Github external
import { Component } from '@angular/core';
import { FdDate } from '@fundamental-ngx/core';

@Component({
    selector: 'fd-date-picker-position-example',
    template: ` 
                <br>
                <div>Selected Date: {{date ? date.toDateString() : 'null'}}</div>`
})
export class DatePickerPositionExampleComponent {

        date = FdDate.getToday();

}
github SAP / fundamental-ngx / apps / docs / src / app / documentation / component-docs / date-picker / examples / date-picker-format-example.component.ts View on Github external
<div>Selected Last Date: {{selectedRange?.end?.toDateString()}}</div>
    `,
    providers: [
        {
            provide: DateFormatParser,
            useClass: DateFormatDashes
        }
    ]
})
export class DatePickerFormatExampleComponent {

    date = FdDate.getToday();

    selectedRange: FdRangeDate = {
        start: FdDate.getToday(),
        end: FdDate.getToday().nextDay()
    };

}
github SAP / fundamental-ngx / apps / docs / src / app / core / component-docs / date-picker / examples / date-picker-form-range-example.component.ts View on Github external
Touched: {{customForm.controls.dates.touched}}<br>
        Dirty: {{customForm.controls.dates.dirty}}<br>
        Valid: {{customForm.controls.dates.valid}}<br>

        Range Start Date: {{ customForm.controls.dates.value.start ? customForm.controls.dates.value.start.toDateString() : 'null' }}<br>
        Range End Date: {{ customForm.controls.dates.value.end ? customForm.controls.dates.value.end.toDateString() : 'null' }}
        
    `
})
export class DatePickerFormRangeExampleComponent {

    customForm = new FormGroup({
        dates: new FormControl({
            start: FdDate.getToday(),
            end: FdDate.getToday().nextDay()
        })
    });
}
github SAP / fundamental-ngx / apps / docs / src / app / core / component-docs / date-picker / examples / date-picker-allow-null-example.component.ts View on Github external
import { Component } from '@angular/core';
import { FdDate } from '@fundamental-ngx/core';

@Component({
    selector: 'fd-date-picker-allow-null-example',
    template: `
        
        <br>
        <div>Selected Date: {{date ? date.toDateString() : 'null'}}</div>`
})
export class DatePickerAllowNullExampleComponent {

    date = FdDate.getToday();

}
github SAP / fundamental-ngx / apps / docs / src / app / core / component-docs / date-picker / examples / date-picker-i18n-example.component.ts View on Github external
provide: CalendarI18nLabels,
            useClass: CustomI18nLabels
        }
    ]
})
export class DatePickerI18nExampleComponent implements AfterViewInit {

    selected: number = 3;

    constructor(
        private languageService: LanguageService,
        private calendarI18n: CalendarI18n,
        private calendarI18nLabels: CalendarI18nLabels
    ) {}

    date = FdDate.getToday();

    isSelected(language: string) {
        switch (language) {
            case 'fr': {
                return this.selected === 1 ? 'selected' : '';
            }
            case 'de': {
                return this.selected === 2 ? 'selected' : '';
            }
            case 'bg': {
                return this.selected === 3 ? 'selected' : '';
            }
        }
    }

    setGerman() {
github SAP / fundamental-ngx / apps / docs / src / app / core / component-docs / calendar / examples / calendar-programmatically-change-example.component.ts View on Github external
<br>
        <div>Selected Date: {{date.toDateString()}}</div>
        <button>Next Day</button>
    `,
    styles: [
        `
            button {
                margin-top: 1rem;
            }
        `
    ]
})
export class CalendarProgrammaticallyChangeExampleComponent {

    date = FdDate.getToday();

    public changeDay() {
        this.date = this.date.nextDay();
    }
}

@fundamental-ngx/core

Fundamental Library for Angular - core

Apache-2.0
Latest version published 2 months ago

Package Health Score

86 / 100
Full package analysis

Similar packages