bildpunkt / surfbird

A Microblogging client built on Electron and Vue
MIT License
331 stars 56 forks source link

feat(post/vue-timeago): Added date to posts with vue-timeago #73

Closed Fubinator closed 6 years ago

Fubinator commented 6 years ago

Added the correct date to posts and quoted posts with vue-timeago

feat #70

Description

Implemented #70

Requirements

Fubinator commented 6 years ago

By importing i18n into the main.js file the language of the given date could be automatically localized:

import i18n from './i18n'

...

Vue.use(VueTimeago, {
  locale: i18n.locale,
  locales: {
    'en': require('vue-timeago/locales/en-US.json'),
    'de': require('vue-timeago/locales/de-DE.json')
  }
})

I guess it makes sense, but I wanted to ask if I should implement it before commiting.

pixeldesu commented 6 years ago

@Fubinator I wonder if it is reactive over that way, since we only seem to pass the locale for the initial use-statement.

pixeldesu commented 6 years ago

I checked this feature and it works fine, as intended and the implementation looks clean! 👍

If you want to, you can try out the things you have suggested yourself, otherwise I think this is ready!

Fubinator commented 6 years ago

Good point. I just ran a test to check if it's reactive and it is not. I'm going to keep that problem in mind. It will be a problem in the future when the user can change the language by himself, so I don't think it's that urgent to implement it right now.

pixeldesu commented 6 years ago

Okay, so I'll guess we leave this as it is and just merge it then? :P

Fubinator commented 6 years ago

Yep sounds fine.