mirror of
https://github.com/himool/HimoolERP.git
synced 2024-11-10 08:55:40 +08:00
fix: 处理日期格式
This commit is contained in:
parent
a7b7d60d6b
commit
7dd418a359
1 changed files with 2 additions and 2 deletions
|
@ -28,8 +28,8 @@ class PurchaseOrder(Model):
|
|||
|
||||
@classmethod
|
||||
def get_number(cls, team):
|
||||
start_date, end_date = pendulum.today(), pendulum.tomorrow()
|
||||
instance = cls.objects.filter(team=team, create_time__gte=start_date.format('YYYY-MM-DD HH:mm:ss'), create_time__lt=end_date.format('YYYY-MM-DD HH:mm:ss')).last()
|
||||
start_date, end_date = pendulum.today().to_date_string(), pendulum.tomorrow().to_date_string()
|
||||
instance = cls.objects.filter(team=team, create_time__gte=start_date, create_time__lt=end_date).last()
|
||||
|
||||
try:
|
||||
result = re.match('^(.*?)([1-9]+)$', instance.number)
|
||||
|
|
Loading…
Reference in a new issue