Open andrey-yantsen opened 5 years ago
This is perhaps best achieved with a system console config option on the plugin, enabled in the chooseClosest
func.
Nice idea, but I'm not sure if it'll meet everybody needs: i.e. we have users from London, UK and from Austin, US, and I'm not sure whether everybody would be happy with forcing to use either AM/PM or 24h.
Great point. Next idea is to check the 12/24 clock setting of the user, and parse accordingly based on that.
Preliminary inspection of the model.User
object don't show this, but with some more digging I will find it. Perhaps stored in Props?
https://github.com/mattermost/mattermost-server/blob/master/model/user.go#L59-L90
Yeah, this one is the best option, I think.
Not sure about Props, but web client gets it from /api/v4/users/me/preferences
, use_military_time=true
means 24-hour clock enabled.
FYI: 12-hour only in these countries: (Quebec also primarily 24 hours, by the way. As does the US military, as it is weirdly used in the API)
So the main part of the world uses 24 hours system.
Summary
Treat 11:30 as 11:30AM. I understand that there are lots of people who using AM/PM, but some parts of the world just haven't had a chance to get used to it. I have 24hrs enabled in my mattermost client, so I'm expecting all times to be in that format, therefore when I'm asking something like
/remind me poke Josh at 11:30
when it's 1PM already, I'm expecting the reminder to be set for tomorrow 11:30AM, and not for today 11:30PM.Describe alternatives you've considered
As for now I have to always type AM/PM to not get the misunderstanding, but it's kinda painful when you haven't been using AM/PM at all in your entire life.