aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/shared/misc
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/shared/misc')
-rw-r--r--client/src/app/shared/misc/utils.ts14
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
3import { DatePipe } from '@angular/common'
3import { environment } from '../../../environments/environment' 4import { environment } from '../../../environments/environment'
4import { AuthService } from '../../core/auth' 5import { AuthService } from '../../core/auth'
5 6
@@ -49,9 +50,20 @@ function getAbsoluteAPIUrl () {
49 return absoluteAPIUrl 50 return absoluteAPIUrl
50} 51}
51 52
53const datePipe = new DatePipe('en')
54function dateToHuman (date: string) {
55 return datePipe.transform(date, 'medium')
56}
57
58function isInMobileView () {
59 return window.innerWidth < 600
60}
61
52export { 62export {
53 viewportHeight, 63 viewportHeight,
54 getParameterByName, 64 getParameterByName,
55 populateAsyncUserVideoChannels, 65 populateAsyncUserVideoChannels,
56 getAbsoluteAPIUrl 66 getAbsoluteAPIUrl,
67 dateToHuman,
68 isInMobileView
57} 69}