Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Fixed regression and started more targeted loading of javascript functions from our own js modules. * Create draft PR for #116 * Fix bug due to redefining older javascript content as a js module. * Changelog entry * More targeted loading of js functions from module Co-authored-by: Flix6x <Flix6x@users.noreply.github.com> Co-authored-by: F.N. Claessen <felix@seita.nl> Co-authored-by: Felix Claessen <30658763+Flix6x@users.noreply.github.com>
- Loading branch information
1 parent
22fc9c4
commit 243c483
Showing
5 changed files
with
22 additions
and
23 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// Date range utils | ||
export function subtract(oldDate, nDays) { | ||
var newDate = new Date(oldDate) | ||
newDate.setDate(newDate.getDate() - nDays); | ||
return newDate; | ||
} | ||
export function thisMonth(oldDate) { | ||
var d1 = new Date(oldDate) | ||
d1.setDate(1); | ||
var d2 = new Date(d1.getFullYear(), d1.getMonth() + 1, 0); | ||
return [d1, d2]; | ||
}; | ||
export function lastNMonths(oldDate, nMonths) { | ||
var d0 = new Date(oldDate) | ||
var d1 = new Date(d0.getFullYear(), d0.getMonth() - nMonths + 2, 0); | ||
d1.setDate(1); | ||
var d2 = new Date(d0.getFullYear(), d0.getMonth() + 1, 0); | ||
return [d1, d2]; | ||
}; |
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