Repository navigation
fix(feature_flags): match days of week regardless of locale - #8707
anishmehta24 wants to merge 1 commit into
Conversation
|
Thanks a lot for your first contribution! Please check out our contributing guidelines and don't hesitate to ask whatever you need. |
|
leandrodamascena
left a comment
There was a problem hiding this comment.
Thanks @anishmehta24, confirmed with a real de_DE locale here: on develop a DAYS=["SATURDAY"] rule stops matching as soon as strftime says Samstag, with your change it keeps matching, and the English locale behaves exactly as before.
I'm approving now. This goes out in 3.40.0, so it will sit here for a while before I merge it. No rebase needed in the meantime, and you'll be credited in the release notes.



Issue number: closes #8706
Summary
Changes
compare_days_of_weeknamed the current day withstrftime("%A").upper(), which follows the process'sLC_TIMElocale, so under a German locale Friday becameFREITAGand never matchedFRIDAY. It now looks the day up fromdatetime.weekday()in a tuple built from theTimeValuesday names.Added
test_time_based_days_range_rule_match_with_non_english_locale, which returns adatetimewhosestrftimegives German day names; it fails ondevelop. The feature flags tests pass.User experience
Before: a
SCHEDULE_BETWEEN_DAYS_OF_WEEKrule silently stops matching if the function sets a non-EnglishLC_TIME. After: the rule matches on the configured days regardless of locale.By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.