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

Default Hour Offset #173

Open
jonmifsud opened this issue Sep 16, 2015 · 4 comments
Open

Default Hour Offset #173

jonmifsud opened this issue Sep 16, 2015 · 4 comments

Comments

@jonmifsud
Copy link
Contributor

I'm not sure this makes much sense but putting it out there if anyone thinks it could be remotely useful. Had a request by a client so that any manually input date would by default take an hour other than midnight. The idea is that they would publish content in their morning every day, and as they prepare their content in advance they would always need to put the hour offset manually after typing in the date.

I have managed to add the offset through the get query, however it would be as a 'system wide' setting not on a per field/section basis. I'm not sure if anyone has use-cases where this would be applicable.

@nitriques
Copy link
Member

I'm not sure if anyone has use-cases where this would be applicable.

I never had it, but I can see the usefulness. I made the changes that makes it midnight because the old version used the current time, which broke a couple of "publish" date fields.

But, this change was made only for date without time: I do not see the point of setting a default hour when the user can't edit it. So the setting I would see would be "default time" and would only take effect when the user can edit the time...

@nitriques
Copy link
Member

Ref: #159

@jonmifsud
Copy link
Contributor Author

@nitriques I've more or less got this working - just need to add the appropriate setting, which I think should go on a per-field basis defaulting to "12:00" as is currently.

The only 'thing' that I've got left to edit is the 'content.get.php' currently that just takes the string makes sure it's valid and returns the timestamp. It currently doesn't care which field it's running off, so I'd need to pass at least the field-id in case there are multiple fields with different settings.

The use-case for this would be when someone types in a date without time - I think we would still want to add the default time offset.

@nitriques
Copy link
Member

Please send a PR when ready so we can do a code review :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants