mattermost-plugin-remind icon indicating copy to clipboard operation
mattermost-plugin-remind copied to clipboard

Improve 24h time format handling

Open andrey-yantsen opened this issue 5 years ago • 5 comments

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.

andrey-yantsen avatar Sep 03 '19 11:09 andrey-yantsen

This is perhaps best achieved with a system console config option on the plugin, enabled in the chooseClosest func.

scottleedavis avatar Sep 03 '19 14:09 scottleedavis

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.

andrey-yantsen avatar Sep 03 '19 18:09 andrey-yantsen

Great point. Next idea is to check the 12/24 clock setting of the user, and parse accordingly based on that. Screen Shot 2019-09-03 at 11 08 57 AM

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

scottleedavis avatar Sep 03 '19 18:09 scottleedavis

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.

andrey-yantsen avatar Sep 03 '19 19:09 andrey-yantsen

FYI: 12-hour only in these countries: am pm (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.

VincentSC avatar Sep 24 '19 08:09 VincentSC