Skip to content

Commit

Permalink
修复周日的明天是本周一
Browse files Browse the repository at this point in the history
  • Loading branch information
nano71 committed Nov 28, 2021
1 parent 3d20dd8 commit be1894e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions lib/common/init.dart
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,15 @@ initTomorrowSchedule() async {
}
}

await _schedule[_week][_getWeekDay()].forEach((k, v) => {
if (v[1] != "null") {v.add(k), tomorrow.add(v)}
});
if (DateTime.now().weekday <= 6) {
await _schedule[_week][_getWeekDay()].forEach((k, v) => {
if (v[1] != "null") {v.add(k), tomorrow.add(v)}
});
} else {
await _schedule[(int.parse(_week) + 1).toString()][_getWeekDay()].forEach((k, v) => {
if (v[1] != "null") {v.add(k), tomorrow.add(v)}
});
}
if (tomorrow.isNotEmpty) {
tomorrowScheduleTitle = "明天的";
tomorrowSchedule = tomorrow;
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
# In iOS, build-name is used as CFBundleShortVersionString while build-number used as CFBundleVersion.
# Read more about iOS versioning at
# https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
version: 1.1.211124+4
version: 1.1.211128+5

environment:
sdk: ">=2.12.0 <3.0.0"
Expand Down

0 comments on commit be1894e

Please sign in to comment.