Skip to content

Support model-attribute of type: :date #42

Open

Description

@A5308Y
No description provided.

Activity

  1. changed the title [-]Support attribute with `type: :date`[/-] [+]Support model-attribute of `type: :date`[/+] on Nov 23, 2021
  2. A5308Y commented on Nov 23, 2021

    @A5308Y
    CollaboratorAuthor

    I just realised we have :date_time and it gets parsed as a ruby DateTime, which we almost certainly don't need here.

    https://ruby-doc.org/stdlib-2.6.1/libdoc/date/rdoc/DateTime.html says:

    So when should you use DateTime in Ruby and when should you use Time? Almost certainly you’ll want to use Time since your app is probably dealing with current dates and times. However, if you need to deal with dates and times in a historical context you’ll want to use DateTime to avoid making the same mistakes as UNESCO. If you also have to deal with timezones then best of luck - just bear in mind that you’ll probably be dealing with local solar times, since it wasn’t until the 19th century that the introduction of the railways necessitated the need for Standard Time and eventually timezones.

    This is a major gotcha coming considering what "datetime" often means in a DB context.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions