date-fns#differenceInCalendarQuarters TypeScript Examples

The following examples show how to use date-fns#differenceInCalendarQuarters. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: quarter.ts    From ngx-gantt with MIT License 6 votes vote down vote up
getSecondaryDatePoints(): GanttDatePoint[] {
        const quarters = differenceInCalendarQuarters(this.end.value, this.start.value);
        const points: GanttDatePoint[] = [];
        for (let i = 0; i <= quarters; i++) {
            const start = this.start.addQuarters(i);
            const point = new GanttDatePoint(
                start,
                start.format(this.options.dateFormat.quarter),
                i * this.getCellWidth() + this.getCellWidth() / 2,
                secondaryDatePointTop
            );
            points.push(point);
        }
        return points;
    }