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

Fix datetime casting and allow model_format #93

Merged
merged 1 commit into from
Mar 19, 2024

Conversation

esmarkowski
Copy link
Member

This pull request fixes the datetime casting issue and adds support for a custom format in the DateTime attribute.

class DateTimeMode < StretchyModel
  attribute :custom, :datetime, model_format: '%m/%d/%Y'
end

DateTimeModel.new(custom: '07/17/1918 10:02').custom
#=> Wed, 17 Jul 1918 10:02

@esmarkowski esmarkowski self-assigned this Mar 19, 2024
@esmarkowski esmarkowski merged commit 193a66d into main Mar 19, 2024
5 checks passed
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

Successfully merging this pull request may close these issues.

1 participant