(result.startsWith("Monday,") || result.startsWith("Tuesday,") ||
Yes, this is fairly "ick" but there are two reasons. First, it wasn't easy at this point in the code to get access to the input dateStyle to check if it's "full". Second, doing it this way is the most conservative and doesn't risk changing anything other than a comma following a full weekday.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Code-Review | +1 |
(result.startsWith("Monday,") || result.startsWith("Tuesday,") ||
Yes, this is fairly "ick" but there are two reasons. First, it wasn't easy at this point in the code to get access to the input dateStyle to check if it's "full". Second, doing it this way is the most conservative and doesn't risk changing anything other than a comma following a full weekday.
I'm not too familiar with ICU, but glancing over the API, would something like `date_format.toPattern().startsWith("EEEE,")` work? Or is it bad because of allocation? Either way, probably your review comment here should be a code comment.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
(result.startsWith("Monday,") || result.startsWith("Tuesday,") ||
Leszek SwirskiYes, this is fairly "ick" but there are two reasons. First, it wasn't easy at this point in the code to get access to the input dateStyle to check if it's "full". Second, doing it this way is the most conservative and doesn't risk changing anything other than a comma following a full weekday.
I'm not too familiar with ICU, but glancing over the API, would something like `date_format.toPattern().startsWith("EEEE,")` work? Or is it bad because of allocation? Either way, probably your review comment here should be a code comment.
Great suggestion, I didn't know I could get the pattern out here, but it works.
I also went looking for a place where the pattern is first chosen to see if I could change it there, but it turns out CreateICUDateFormat isn't called as part of the test I wrote. I stepped around in a debugger and couldn't find a place where we have the pattern, so I think it's created inside of ICU and isn't extracted elsewhere in all situations.
I put the toPattern() bit last and explained why. The hope is that this code is never enabled, it's only for an emergency and would then be short lived.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Auto-Submit | +1 |
Commit-Queue | +1 |
I'll need two LGTMs on this, and my changes invalidated the first one :)
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Code-Review | +1 |
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Commit-Queue | +2 |
(result.startsWith("Monday,") || result.startsWith("Tuesday,") ||
Leszek SwirskiYes, this is fairly "ick" but there are two reasons. First, it wasn't easy at this point in the code to get access to the input dateStyle to check if it's "full". Second, doing it this way is the most conservative and doesn't risk changing anything other than a comma following a full weekday.
Philip JägenstedtI'm not too familiar with ICU, but glancing over the API, would something like `date_format.toPattern().startsWith("EEEE,")` work? Or is it bad because of allocation? Either way, probably your review comment here should be a code comment.
Great suggestion, I didn't know I could get the pattern out here, but it works.
I also went looking for a place where the pattern is first chosen to see if I could change it there, but it turns out CreateICUDateFormat isn't called as part of the test I wrote. I stepped around in a debugger and couldn't find a place where we have the pattern, so I think it's created inside of ICU and isn't extracted elsewhere in all situations.
I put the toPattern() bit last and explained why. The hope is that this code is never enabled, it's only for an emergency and would then be short lived.
Marked as resolved.
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Add flag to revert ICU 76 changes for commas in en-AU/GB/IN
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |