Skip to content

DateField should parse on attribution #8

Description

@rochacbruno

As esengine uses dateutils.parser it can handle date parsing on attribution.

only when _strict == False

class Doc(Document):
    date = DateField()

doc = Doc()

doc.date = "2010-01-01"
doc.date = "2010-01-01 15:30:22"
doc.date = "15/03/2010"

# should all be parsed to datetime.datetime(2010, 01, 01)

isinstance(doc.date, datetime)
True

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions