mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-08-14 00:26:21 +00:00
Change: treat created as date not datetime (#9793)
This commit is contained in:
@@ -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):
|
||||
|
Reference in New Issue
Block a user