mirror of
https://github.com/documize/community.git
synced 2025-07-19 21:29:42 +02:00
view activity date formatting
This commit is contained in:
parent
cce1b5ef50
commit
66bc874d95
5 changed files with 12 additions and 4303 deletions
|
@ -10,7 +10,6 @@
|
||||||
// https://documize.com
|
// https://documize.com
|
||||||
|
|
||||||
import { inject as service } from '@ember/service';
|
import { inject as service } from '@ember/service';
|
||||||
|
|
||||||
import Component from '@ember/component';
|
import Component from '@ember/component';
|
||||||
|
|
||||||
export default Component.extend({
|
export default Component.extend({
|
||||||
|
|
|
@ -13,7 +13,10 @@ import { helper } from '@ember/component/helper';
|
||||||
import dateUtil from '../utils/date';
|
import dateUtil from '../utils/date';
|
||||||
|
|
||||||
export function formattedDate(params) {
|
export function formattedDate(params) {
|
||||||
return dateUtil.toIsoDate(params[0], params[1]);
|
let format = params[1];
|
||||||
|
if (is.undefined(format)) format = 'Do MMMM YYYY, HH:mm';
|
||||||
|
|
||||||
|
return moment(params[0]).format(format);
|
||||||
}
|
}
|
||||||
|
|
||||||
export default helper(formattedDate);
|
export default helper(formattedDate);
|
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
> .item {
|
> .item {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 20px 0;
|
padding: 15px 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
|
|
||||||
> .avatar-box {
|
> .avatar-box {
|
||||||
|
@ -24,6 +24,7 @@
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
background-color: $color-gray;
|
background-color: $color-gray;
|
||||||
color: $color-white;
|
color: $color-white;
|
||||||
|
vertical-align: middle;
|
||||||
|
|
||||||
margin: 0 20px 0 0;
|
margin: 0 20px 0 0;
|
||||||
}
|
}
|
||||||
|
@ -32,14 +33,14 @@
|
||||||
display: inline-block;
|
display: inline-block;
|
||||||
|
|
||||||
> .name {
|
> .name {
|
||||||
display: block;
|
display: inline-block;
|
||||||
font-size: 1.2rem;
|
font-size: 1.2rem;
|
||||||
color: $color-off-black;
|
color: $color-off-black;
|
||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
}
|
}
|
||||||
|
|
||||||
> .detail {
|
> .detail {
|
||||||
display: block;
|
display: inline-block;
|
||||||
font-size: 1rem;
|
font-size: 1rem;
|
||||||
color: $color-gray;
|
color: $color-gray;
|
||||||
|
|
||||||
|
|
|
@ -4,8 +4,8 @@
|
||||||
<li class="item">
|
<li class="item">
|
||||||
<div class="avatar-box">{{user-initials a.firstname a.lastname}}</div>
|
<div class="avatar-box">{{user-initials a.firstname a.lastname}}</div>
|
||||||
<div class="activity">
|
<div class="activity">
|
||||||
<div class="name">{{a.firstname}} {{a.lastname}}</div>
|
<div class="name">{{a.firstname}} {{a.lastname}} </div>
|
||||||
<div class="detail {{a.activityColor}}">{{a.activityLabel}}, {{time-ago a.created}}</div>
|
<div class="detail {{a.activityColor}}">{{a.activityLabel}} on {{formatted-date a.created}}</div>
|
||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
|
|
4298
gui/vendor/moment.js
vendored
4298
gui/vendor/moment.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue