Some tweaks to date formatting frontend
This commit is contained in:
parent
8d313fa0e6
commit
4b4df5baf9
@ -152,7 +152,6 @@
|
||||
<configuration>
|
||||
<arguments>${gruntArg}</arguments>
|
||||
</configuration>
|
||||
<!-- <phase>package</phase> -->
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
@ -79,10 +79,12 @@ Handlebars.registerHelper('avatar', function () {
|
||||
return '<div class="img_cont_msg"> <img src="https://static.turbosquid.com/Preview/001292/481/WV/_D.jpg" class="rounded-circle user_img_msg"> </div>';
|
||||
});
|
||||
Handlebars.registerHelper('fromNow', function (date: string) {
|
||||
if(date == null)
|
||||
return ": Never"
|
||||
return moment(date).fromNow();
|
||||
})
|
||||
Handlebars.registerHelper('msgDateFormat', function (date: string) {
|
||||
return moment(date).calendar(moment.now(), {lastWeek: "DD/MM/YY hh:mm:a", sameElse: "DD/MM/YY hh:mm:a"})
|
||||
return moment(date).calendar(moment.now(), { lastWeek: "DD/MM/YY hh:mm A", sameElse: "DD/MM/YY hh:mm A" })
|
||||
})
|
||||
|
||||
|
||||
|
@ -76,6 +76,9 @@ export class UserModel implements Subject<ActiveUserViewModel> {
|
||||
// log.trace(sessionStorage.getItem('activeUsers'));
|
||||
log.info(`Subject: received ajax active users`);
|
||||
data.map((d: any) => {
|
||||
if( d.lastActive == null )
|
||||
return null;
|
||||
|
||||
d.lastActive = new Date(d.lastActive)
|
||||
return d;
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user