Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compare entire timestamps of embargo_release_date and current time wh… #388

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ def under_embargo?
#permissions = permissions_doc(params[:id])
embargo_key = Hydra.config.permissions.embargo.release_date
if self[embargo_key]
embargo_date = Date.parse(self[embargo_key].split(/T/)[0])
return embargo_date > Date.parse(Time.now.to_s)
embargo_date = DateTime.parse(self[embargo_key])
return embargo_date > DateTime.parse(Time.now.to_s)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can this be DateTime.current on the right hand side?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@weiweishi: is that revision OK to you?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jcoyne DateTime.current doesn't reflect the timezone, and the timestamp may become confusing. Sorry @atz just saw the comments.

end
false
end
Expand Down