mirror of
https://github.com/vale981/Vulcan
synced 2025-03-05 09:31:43 -05:00
test for postedAt (for pending posts)
This commit is contained in:
parent
cfc52b1158
commit
f4c4f9261f
1 changed files with 2 additions and 2 deletions
|
@ -224,7 +224,7 @@ Telescope.callbacks.add("posts.new.sync", PostsNewRequiredPropertiesCheck);
|
|||
* @summary Set the post's isFuture to true if necessary
|
||||
*/
|
||||
function PostsNewSetFuture (post, user) {
|
||||
post.isFuture = post.postedAt.getTime() > post.createdAt.getTime() + 1000; // round up to the second
|
||||
post.isFuture = post.postedAt && post.postedAt.getTime() > post.createdAt.getTime() + 1000; // round up to the second
|
||||
return post;
|
||||
}
|
||||
Telescope.callbacks.add("posts.new.sync", PostsNewSetFuture);
|
||||
|
@ -331,7 +331,7 @@ Telescope.callbacks.add("posts.edit.sync", PostsEditForceStickyToFalse);
|
|||
*/
|
||||
function PostsEditSetIsFuture (modifier, post) {
|
||||
// if a post's postedAt date is in the future, set isFuture to true
|
||||
modifier.$set.isFuture = modifier.$set.postedAt.getTime() > new Date().getTime() + 1000;
|
||||
modifier.$set.isFuture = modifier.$set.postedAt && modifier.$set.postedAt.getTime() > new Date().getTime() + 1000;
|
||||
return modifier;
|
||||
}
|
||||
Telescope.callbacks.add("posts.edit.sync", PostsEditSetIsFuture);
|
||||
|
|
Loading…
Add table
Reference in a new issue