1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-04 18:29:27 +02:00

Fix human dates in result lists

This commit is contained in:
Chocobozzz 2018-01-31 10:41:44 +01:00
parent 915c5bbe53
commit 61bbc72775
No known key found for this signature in database
GPG key ID: 583A612D890159BE
6 changed files with 20 additions and 38 deletions

View file

@ -1,5 +1,6 @@
// Thanks: https://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript
import { DatePipe } from '@angular/common'
import { environment } from '../../../environments/environment'
import { AuthService } from '../../core/auth'
@ -49,9 +50,20 @@ function getAbsoluteAPIUrl () {
return absoluteAPIUrl
}
const datePipe = new DatePipe('en')
function dateToHuman (date: string) {
return datePipe.transform(date, 'medium')
}
function isInMobileView () {
return window.innerWidth < 600
}
export {
viewportHeight,
getParameterByName,
populateAsyncUserVideoChannels,
getAbsoluteAPIUrl
getAbsoluteAPIUrl,
dateToHuman,
isInMobileView
}