Opened 18 years ago

Last modified 14 years ago

#1104 closed enhancement

Correct DateField to not include Time — at Initial Version

Reported by: mildly@… Owned by: Adrian Holovaty
Component: Metasystem Version: dev
Severity: normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Index: django/core/meta/fields.py
===================================================================
--- django/core/meta/fields.py (revision 1764)
+++ django/core/meta/fields.py (working copy)
@@ -391,9 +391,9 @@

def get_db_prep_lookup(self, lookup_type, value):

if lookup_type == 'range':

  • value = [str(v) for v in value]

+ value = [v.strftime("%Y-%m-%d") for v in value]

else:

  • value = str(value)

+ value = value.strftime("%Y-%m-%d")

return Field.get_db_prep_lookup(self, lookup_type, value)

def pre_save(self, value, add):

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top