kandanapp / kandan

Kandan is an Open Source Alternative to HipChat
GNU Affero General Public License v3.0
2.72k stars 408 forks source link

display time #416

Open msslava opened 9 years ago

msslava commented 9 years ago

By default, the post is displayed as "x" days ago. How to make that time was such 12.12.2014 HH: mm: ss? Very inconvenient to count the days ago when you need to find out the exact date of the post. As a suggestion: can add a date separator messages?

scouttyg commented 9 years ago

What we might do is add a hover ability to a date (similar to what Github does) so that way you can see the exact "time" something was posted by hovering over a date with an unspecified time (ie, the x days ago you are talking about)

msslava commented 9 years ago

It would be cool if you could do both at the githab!

scouttyg commented 9 years ago

Just pushed up a small fix to help with this. Not sure what you mean by date separator messages though -- let me know more in depth and we can perhaps add this as well.

msslava commented 9 years ago

Thank you for the quick response! It works.

Not sure what you mean by date separator messages though

for example: example Thank you!

scouttyg commented 9 years ago

This might take a few days and be put on the backburner, because it's slightly more complicated.

Right now, we loop through the activities as follows:

    if @channel.activities
      for activity in @channel.activities.models
        activityView = new Kandan.Views.ShowActivity({activity: activity, state: Kandan.Helpers.Activities.HISTORY_STATE})
        $(@el).append(activityView.render().el)

Basically, a simple for loop that appends each activity event to the dom.

In order to have date separators, we'd need to create a hash grouped by days so that way after each grouping we could list the date separator. While not that big a deal (basically @activities.group_by(&:date), there'd have to be logic to make sure it grouped it correctly based on your time zone, and also append the date correctly to the view.

It's not really hard, but it would take a bit more thought than just adding the same time formatted differently as a hover.

I'll added it to our list, so look out for it maybe a few weeks from now.

msslava commented 9 years ago

Great news! Thank you!

miurahr commented 9 years ago

:+1: Now I'm waiting a progress for date separator.