Closed katlyn closed 3 years ago
Hey, first of all thanks for submitting an issue!
Fixed some cases where the parsing was just not working at all. Almost all the cases that you listed in this issue should work. The only one I couldn't parse at all was AEST because the support for abbreviations is a bit flawed.
Now the parsing should remaing consistent with the help/error message. If you detect any error or inconsistency feel free to reopen this issue.
The help message for setting a user's timezone is as follows:
In addition, when a user gives malformed input with the timezone command, this is returned.
However, when attempting to set the timezone none of the provided formats are successful. The following commands all returned an error saying the timezone could not be parsed (listen roughly in order of being attempted).
!timezone America/Denver
!timezone MST
(worked but did not return correct timezone)!timezone -07:00
!timezone UTC-07:00
!timezone Australia/Sydney
!timezone AEST
In the end, I was able to go through the source code and find out from the test for TimezoneParser that providing the timezone database name without a region (just the city, eg
!timezone Denver
) would work. After testing, this indeed did work, but without looking through the source code I never would have discovered that using that format would allow the command to complete successfully.Ideally the parsing should be updated to match the formatting that is given in help messages, though an update to the help message to clarify the formats expected would also be good.