mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-12-22 18:31:57 +03:00
af4bfb8862
- purely for cleanliness! - we use kebabcase by default - tests should be kebab-case-file_spec.js (one day we want this to be .test.js)
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;
|