-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change lots of things about reducing
- Loading branch information
Showing
17 changed files
with
110 additions
and
91 deletions.
There are no files selected for viewing
Submodule packages-premium
updated
from 77fae2 to 7ca7da
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,44 @@ | ||
import { DateEnv } from './datelib/env'; | ||
import { DateProfile } from './DateProfileGenerator'; | ||
|
||
export interface ViewApi { | ||
type: string | ||
title: string | ||
activeStart: Date | ||
activeEnd: Date | ||
currentStart: Date | ||
currentEnd: Date | ||
} | ||
import { DateEnv } from './datelib/env' | ||
import { CalendarState } from 'fullcalendar' | ||
|
||
|
||
export class ViewApi { | ||
export class ViewApi { // always represents the current view | ||
|
||
constructor( | ||
public type: string, | ||
dateProfile: DateProfile, | ||
public title: string, | ||
private options: any, | ||
dateEnv: DateEnv | ||
private getCurrentState: () => CalendarState, | ||
private dateEnv: DateEnv | ||
) { | ||
this.activeStart = dateEnv.toDate(dateProfile.activeRange.start) | ||
this.activeEnd = dateEnv.toDate(dateProfile.activeRange.end) | ||
this.currentStart = dateEnv.toDate(dateProfile.currentRange.start) | ||
this.currentEnd = dateEnv.toDate(dateProfile.currentRange.end) | ||
} | ||
|
||
|
||
get title() { | ||
return this.getCurrentState().viewTitle | ||
} | ||
|
||
|
||
get activeStart() { | ||
return this.dateEnv.toDate(this.getCurrentState().dateProfile.activeRange.start) | ||
} | ||
|
||
|
||
get activeEnd() { | ||
return this.dateEnv.toDate(this.getCurrentState().dateProfile.activeRange.end) | ||
} | ||
|
||
|
||
get currentStart() { | ||
return this.dateEnv.toDate(this.getCurrentState().dateProfile.currentRange.start) | ||
} | ||
|
||
|
||
get currentEnd() { | ||
return this.dateEnv.toDate(this.getCurrentState().dateProfile.currentRange.end) | ||
} | ||
|
||
|
||
getOption(name: string) { | ||
return this.options[name] | ||
return this.getCurrentState().options[name] // are the view-specific options | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.