mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 10:21:36 +03:00
c81d11b910
closes #12059 - Published Time and Modified Time were not populating for 'page' context because it is an extension of 'post' and hence there was no context 'page'. - Fixed it by using the common contextObject & `getContextObject` utility. - Should also fix some other missing parameters.
19 lines
445 B
JavaScript
19 lines
445 B
JavaScript
const getContextObject = require('./context_object.js');
|
|
|
|
function getModifiedDate(data) {
|
|
let context = data.context ? data.context : null;
|
|
let modDate;
|
|
|
|
const contextObject = getContextObject(data, context);
|
|
|
|
if (contextObject) {
|
|
modDate = contextObject.updated_at || null;
|
|
if (modDate) {
|
|
return new Date(modDate).toISOString();
|
|
}
|
|
}
|
|
return null;
|
|
}
|
|
|
|
module.exports = getModifiedDate;
|