-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Fixed tariff: fix sorting zones with deviating months or days #26425
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
| }{ | ||
| // REVERSED: specific first, general second | ||
| // Without MoreSpecific, this will fail! | ||
| {0.10, "0-5", "Jan-Mar,Oct-Dec"}, // specific (winter only) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am Ende müssen vmtl. auch Überlappungen gehandhabt werden? In jedem Fall wäre es schön diese- wenn nicht vergleichbar- als Fehler identifizieren zu können.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aber nur wenn wirklich "ambigious"? Das braucht ein paar Helper
This reverts commit 3794bef.
|
test fails since logging |
| // Sort markers by time to ensure correct ordering | ||
| slices.SortFunc(res, func(a, b HourMin) int { | ||
| return a.Minutes() - b.Minutes() | ||
| }) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
major required fix - paired with correcting rates clock
| var res api.Rates | ||
|
|
||
| start := now.With(t.clock.Now().Local()).BeginningOfDay() | ||
| start := now.With(t.clock.Now()).BeginningOfDay() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
required, fix clock dependencies
|
@andig PR consists of two parts, one fixes a missing sorting and adresses the issue directly - the second parts features overlapping, etc.. Commented them to mark required changes; others enhance robustness. Perhaps slit the PR in fix and features, wdyt. |
Fix #26164, includes #26413
adds