This is a request that was made by djsunrise19 on GitHub which i will quote below:
Hi,
today I've seen another behavior. I had an event at 16 o'clock. I looked on both (MM1 and MM2) mirrors at 15 o'clock:
MM1: displays in 1 hour or in 45 minutes (of course, 15minutes later)
MM²: displays today at 16 o'clock
Is it possible to put this function from MM1 in your MM² app? I know that is a personal feature. But in my opinion the MM1 solution fits way better. So you realize that the event is in the near future.
Perhaps we can make that configurable.
This is my current take on it. I added a timeFormat
config option that allows you to set it to 'absolute'
or 'relative'
. When set to 'relative'
the time display will look like this:
While in 'absolute'
format, it looks like this:
The current code already checks whether an event is happening within the next 48 hours and translates the event time into ‘TODAY at’ or ‘TOMORROW at’. I added another check to see if an event it within the next 6 hours, which will change the time format to ‘in x hours’ which will count down till the event happens:
This is all currently being worked on locally on my fork. Once done I’ll submit a pull request. But I’d like to get feedback from others (as well as from djsunrise19 who originally requested this.) I’d like to know what other enhancements/changes people would like to see.
One thing for me is how I like things displayed. I like the relative time, but only up to a point. For example, if I see an event that says ‘in 2 days’, that will get my attention versus if it said ‘May 4th’. Simply because I may not know what the current date is and see the absolute date won’t mean much. However, at the same time, an event that’s happening 20 days from now, I don’t need it to say ‘in 20 days’. I’m perfectly happy with it saying ‘May 22nd’ on that. So i may add another option, maybe call it 'urgency'
and allow it to be configurable to what one would want. For me that would be a week, so that any event happening within a week, it would say ‘in x days’ where everything else further away would display the absolute date. It’s a combination of having both absolute as well as relative dates displayed. That’s just my preference though.
Thoughts?