projects
/
SonOfLokstallBot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
c545736
)
Misc cleanup
author
Cameron Ball
<cameron@cameron1729.xyz>
Sun, 13 Jan 2019 08:25:39 +0000
(16:25 +0800)
committer
Cameron Ball
<cameron@cameron1729.xyz>
Sun, 13 Jan 2019 08:25:39 +0000
(16:25 +0800)
src/common.php
patch
|
blob
|
history
diff --git
a/src/common.php
b/src/common.php
index
d884459
..
d3561ca
100644
(file)
--- a/
src/common.php
+++ b/
src/common.php
@@
-335,12
+335,10
@@
function getTasksForTheWeek(int $year, int $monthNum, int $weekNum, array $taskM
const getFilePathForWeek = 'getFilePathForWeek';
function getFilePathForWeek(int $year, int $monthNum, int $weekNum, string $base) {
const getFilePathForWeek = 'getFilePathForWeek';
function getFilePathForWeek(int $year, int $monthNum, int $weekNum, string $base) {
- // December is part of next year's summer
- $seasonYear = $year;
return sprintf(
'%s/tasks/%s/%s/%s/week%s.txt',
$base,
return sprintf(
'%s/tasks/%s/%s/%s/week%s.txt',
$base,
- $
seasonY
ear,
+ $
y
ear,
getSeason($monthNum),
getMonthName($monthNum),
$weekNum
getSeason($monthNum),
getMonthName($monthNum),
$weekNum
@@
-423,7
+421,7
@@
function getFilePathsForMonth(int $year, int $monthNum, string $base) {
function getFilePathsForSeason(int $year, string $season, string $base) {
return array_merge(...map(function($monthNum) use ($year, $base) {
// Summer of the current year includes december of the previous year.
function getFilePathsForSeason(int $year, string $season, string $base) {
return array_merge(...map(function($monthNum) use ($year, $base) {
// Summer of the current year includes december of the previous year.
- $seasonYear = $year - (
$monthNum == 12 ? 1 : 0
);
+ $seasonYear = $year - (
int)($monthNum == 12
);
return getFilePathsForMonth($seasonYear, $monthNum, $base);
})(array_filter(range(1,12), function($month) use ($season) {
return getSeason($month) == $season;
return getFilePathsForMonth($seasonYear, $monthNum, $base);
})(array_filter(range(1,12), function($month) use ($season) {
return getSeason($month) == $season;