@datarailsshared/datarailsshared 1.4.98 → 1.4.100

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -15,6 +15,7 @@ export declare class DrDatePickerComponent implements ControlValueAccessor, Afte
15
15
  set max(maxDate: number);
16
16
  periodPosition: DatePickerPeriodPosition;
17
17
  placeholder: string;
18
+ fiscalYearMonthsModifier: number;
18
19
  datePicker: any;
19
20
  calendarViewsTimeframeMapping: any;
20
21
  customHeader: typeof DrDatePickerCustomHeaderComponent;
@@ -1,4 +1,4 @@
1
- import { ChangeDetectorRef, OnDestroy } from '@angular/core';
1
+ import { OnDestroy, ChangeDetectorRef, OnInit } from "@angular/core";
2
2
  import { MatCalendar } from '@angular/material/datepicker';
3
3
  import { DateAdapter } from '@angular/material/core';
4
4
  import { CalendarView, CustomDateFormat, TCalendarView, TimeframeOption } from '../../../models/datePicker';
@@ -10,7 +10,7 @@ export interface ITimeframeOption {
10
10
  format: string;
11
11
  periodLabel: () => string;
12
12
  }
13
- export declare class DrDatePickerCustomHeaderComponent<Moment> implements OnDestroy {
13
+ export declare class DrDatePickerCustomHeaderComponent<Moment> implements OnDestroy, OnInit {
14
14
  private _calendar;
15
15
  private _dateAdapter;
16
16
  private _dateFormats;
@@ -31,7 +31,8 @@ export declare class DrDatePickerCustomHeaderComponent<Moment> implements OnDest
31
31
  periodMonthLabel: string;
32
32
  periodYearLabel: string;
33
33
  readonly calendarView: typeof CalendarView;
34
- constructor(_calendar: MatCalendar<Moment>, _dateAdapter: DateAdapter<Moment>, _dateFormats: CustomDateFormat, cdr: ChangeDetectorRef, datePickerService: DrDatePickerService);
34
+ constructor(_calendar: MatCalendar<any>, _dateAdapter: DateAdapter<Moment>, _dateFormats: CustomDateFormat, cdr: ChangeDetectorRef, datePickerService: DrDatePickerService);
35
+ ngOnInit(): void;
35
36
  ngOnDestroy(): void;
36
37
  setPeriodLabels(): void;
37
38
  setTimeframe(): void;
@@ -40,4 +41,5 @@ export declare class DrDatePickerCustomHeaderComponent<Moment> implements OnDest
40
41
  onSelectQuarter(quarterNumber: number): void;
41
42
  pagingClicked(forward: any): void;
42
43
  pagingDateChange(actionCall: string, amount: number, forward: boolean): void;
44
+ transformDateInMultiyearViewAccordingToFY(): void;
43
45
  }
@@ -11,9 +11,67 @@ export declare class DrDatePickerService {
11
11
  availableTimeframes: TimeframeOption[];
12
12
  formatConfig: IDatePickerFormatConfig;
13
13
  calendarInstance: MatCalendar<any>;
14
+ fiscalYearMonthsModifier: number;
14
15
  getDisplayPrefix(): "" | "Q" | "W";
15
16
  getTimeframe(format: string): TimeframeOption;
16
17
  getConfiguredFormat(timeframe: TTimeframeOption): string;
17
18
  updateTimeframeAndFormat(format: string): void;
18
19
  normalizeValue(value: any): any;
20
+ /**
21
+ * Get quarter number for date according to fiscal year
22
+ *
23
+ * @param date
24
+ */
25
+ getQuarterAccordingToFiscalYear(date: Moment): number;
26
+ /**
27
+ * Sets date to end of quarter in FY by passed quarter number
28
+ *
29
+ * @param date
30
+ * @param quarterNumber
31
+ */
32
+ setEndOfQuarter(date: Moment, quarterNumber: number): void;
33
+ /**
34
+ * Sets date to start of quarter in FY by passed quarter number
35
+ *
36
+ * @param date
37
+ * @param quarterNumber
38
+ */
39
+ setStartOfQuarter(date: Moment, quarterNumber: number): void;
40
+ /**
41
+ * Sets date to end of current quarter (in which date is located) according to FY
42
+ *
43
+ * @param date
44
+ */
45
+ setEndOfCurrentQuarter(date: Moment): void;
46
+ /**
47
+ * Sets date to start of current quarter (in which date is located) according to FY
48
+ *
49
+ * @param date
50
+ */
51
+ setStartOfCurrentQuarter(date: Moment): void;
52
+ /**
53
+ * If date selection on this timeframe depends on Fiscal Year
54
+ *
55
+ * @param timeframe
56
+ */
57
+ isTimeframeDependingOnFY(timeframe: TimeframeOption): boolean;
58
+ /**
59
+ * Subtract from date fiscal year shift months count
60
+ *
61
+ * @param date
62
+ */
63
+ subtractFiscalYearMonthsFromDate(date: Moment): Moment;
64
+ /**
65
+ * Add to date fiscal year shift months count
66
+ *
67
+ * @param date
68
+ */
69
+ addFiscalYearMonthsToDate(date: Moment): Moment;
70
+ /**
71
+ * Add or subtract depending on isRevert paremeter Fiscal year month shift
72
+ *
73
+ * @param date
74
+ * @param isSubtract
75
+ */
76
+ private getDateModifiedByFiscalMonths;
19
77
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@datarailsshared/datarailsshared",
3
- "version": "1.4.98",
3
+ "version": "1.4.100",
4
4
  "description": "DataRails shared components",
5
5
  "keywords": [
6
6
  "angular",