Code

Opened 8 years ago

Closed 8 years ago

Last modified 4 years ago

#1104 closed enhancement (fixed)

[patch] Correct DateField to not include Time

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

Description (last modified by adrian)

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):

Attachments (0)

Change History (5)

comment:1 Changed 8 years ago by adrian

  • Description modified (diff)

Changed formatting in description.

comment:2 Changed 8 years ago by adrian

  • Summary changed from Correct DateField to not include Time to [patch] Correct DateField to not include Time

comment:3 Changed 8 years ago by jacob

  • Resolution set to invalid
  • Status changed from new to closed

Um, without an explanation I'm not going to apply a patch to Django.

comment:4 Changed 4 years ago by jacob

  • Resolution changed from invalid to fixed

(In [12644]) Fixed #1104: set FormWizard.extra_context in __init__ to avoid context leakage.

comment:5 Changed 4 years ago by jacob

(In [12645]) [1.1.X] Fixed #1104: set FormWizard.extra_context in __init__ to avoid context leakage.

Backport of [12644] from trunk.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.