mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-21 22:16:44 +01:00
Change: treat created as date not datetime (#9793)
This commit is contained in:
parent
ce5d4e9c92
commit
1a6f32534c
18 changed files with 228 additions and 128 deletions
|
|
@ -213,7 +213,11 @@ class Document(SoftDeleteModel, ModelWithOwner):
|
|||
),
|
||||
)
|
||||
|
||||
created = models.DateTimeField(_("created"), default=timezone.now, db_index=True)
|
||||
created = models.DateField(
|
||||
_("created"),
|
||||
default=datetime.datetime.today,
|
||||
db_index=True,
|
||||
)
|
||||
|
||||
modified = models.DateTimeField(
|
||||
_("modified"),
|
||||
|
|
@ -291,8 +295,7 @@ class Document(SoftDeleteModel, ModelWithOwner):
|
|||
verbose_name_plural = _("documents")
|
||||
|
||||
def __str__(self) -> str:
|
||||
# Convert UTC database time to local time
|
||||
created = datetime.date.isoformat(timezone.localdate(self.created))
|
||||
created = self.created.isoformat()
|
||||
|
||||
res = f"{created}"
|
||||
|
||||
|
|
@ -371,7 +374,7 @@ class Document(SoftDeleteModel, ModelWithOwner):
|
|||
|
||||
@property
|
||||
def created_date(self):
|
||||
return timezone.localdate(self.created)
|
||||
return self.created
|
||||
|
||||
|
||||
class SavedView(ModelWithOwner):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue