mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
Added exact timestamp to the title attribute of the post date in the … (#19936)
…post list view Ref DES-171
This commit is contained in:
parent
a1afc87757
commit
f8a55de743
2 changed files with 12 additions and 1 deletions
|
@ -55,7 +55,7 @@ export function formatPostTime(timeago, {timezone = 'etc/UTC', format, relative,
|
|||
}
|
||||
|
||||
// Else, render just the date if edited or published, or the time & date if scheduled
|
||||
let f = scheduled ? `[at] HH:mm [${utcOffset}] [on] DD MMM YYYY` : 'DD MMM YYYY';
|
||||
let f = scheduled ? `[at] HH:mm [${utcOffset}] [on] DD MMM YYYY` : (short ? `DD MMM YYYY` : `HH:mm [${utcOffset}] DD MMM YYYY`);
|
||||
return time.format(f);
|
||||
}
|
||||
|
||||
|
|
|
@ -127,6 +127,17 @@ describe('Integration: Helper: gh-format-post-time', function () {
|
|||
this.set('mockDate', mockDate);
|
||||
|
||||
await render(hbs`{{gh-format-post-time mockDate absolute=true}}`);
|
||||
expect(this.element).to.have.trimmed.text('16:00 (UTC) 02 Sep 2017');
|
||||
});
|
||||
|
||||
it('returns correct short format if post was published prior to yesterday', async function () {
|
||||
let {mockDate} = setupMockDate({
|
||||
date: '2017-09-02T16:00:00Z',
|
||||
utcDate: '2017-09-06T18:00:00Z'
|
||||
});
|
||||
this.set('mockDate', mockDate);
|
||||
|
||||
await render(hbs`{{gh-format-post-time mockDate absolute=true short=true}}`);
|
||||
expect(this.element).to.have.trimmed.text('02 Sep 2017');
|
||||
});
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue