diff options
Diffstat (limited to 'client/src/app/shared/misc')
-rw-r--r-- | client/src/app/shared/misc/utils.ts | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/client/src/app/shared/misc/utils.ts b/client/src/app/shared/misc/utils.ts index 23b46812b..0e6e6b366 100644 --- a/client/src/app/shared/misc/utils.ts +++ b/client/src/app/shared/misc/utils.ts | |||
@@ -1,5 +1,6 @@ | |||
1 | // Thanks: https://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript | 1 | // Thanks: https://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript |
2 | 2 | ||
3 | import { DatePipe } from '@angular/common' | ||
3 | import { environment } from '../../../environments/environment' | 4 | import { environment } from '../../../environments/environment' |
4 | import { AuthService } from '../../core/auth' | 5 | import { AuthService } from '../../core/auth' |
5 | 6 | ||
@@ -49,9 +50,20 @@ function getAbsoluteAPIUrl () { | |||
49 | return absoluteAPIUrl | 50 | return absoluteAPIUrl |
50 | } | 51 | } |
51 | 52 | ||
53 | const datePipe = new DatePipe('en') | ||
54 | function dateToHuman (date: string) { | ||
55 | return datePipe.transform(date, 'medium') | ||
56 | } | ||
57 | |||
58 | function isInMobileView () { | ||
59 | return window.innerWidth < 600 | ||
60 | } | ||
61 | |||
52 | export { | 62 | export { |
53 | viewportHeight, | 63 | viewportHeight, |
54 | getParameterByName, | 64 | getParameterByName, |
55 | populateAsyncUserVideoChannels, | 65 | populateAsyncUserVideoChannels, |
56 | getAbsoluteAPIUrl | 66 | getAbsoluteAPIUrl, |
67 | dateToHuman, | ||
68 | isInMobileView | ||
57 | } | 69 | } |