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:
parent
915c5bbe53
commit
61bbc72775
6 changed files with 20 additions and 38 deletions
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue