mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-30 14:22:07 +03:00
dcc8bcc4f1
refs #6534 - fixes a bug where published_at was incorrectly falling back to the created_at date - updated meta index to get author name - add written by & filed under labels + data if the values are present (only on posts/pages) - updated tests
10 lines
274 B
JavaScript
10 lines
274 B
JavaScript
function getPublishedDate(data) {
|
|
var context = data.context ? data.context[0] : null;
|
|
if (data[context] && data[context].published_at) {
|
|
return new Date(data[context].published_at).toISOString();
|
|
}
|
|
return null;
|
|
}
|
|
|
|
module.exports = getPublishedDate;
|