Skip to content

Commit

Permalink
Update date input format in UserTableForm to use ISO format (YYYY-MM-DD)
Browse files Browse the repository at this point in the history
  • Loading branch information
SimoneBendazzoli93 committed Feb 19, 2025
1 parent 2852465 commit 4e41a09
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions dashboard/apps/user_management/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ def __init__(self, *args, **kwargs):
choices=cpu_limit,
)
elif k.startswith("date"):
self.fields[k] = forms.DateField(label='date',widget=forms.DateInput(format="%d-%m-%Y", attrs={"type": "date"}),
input_formats=["%d-%m-%Y"])
self.fields[k] = forms.DateField(label='date',widget=forms.DateInput(format="%Y-%m-%d", attrs={"type": "date"}),
input_formats=["%Y-%m-%d"])
elif k.startswith("conda"):
self.fields[k] = forms.FileField(label='conda')
elif k.startswith("cluster"):
Expand Down Expand Up @@ -96,7 +96,7 @@ def __init__(self, *args, **kwargs):
self.fields[f"cpu_limit_{project_name}"] = forms.ChoiceField(label='cpu_limit', choices=cpu_limit,
initial=kwargs["projects"][i]["cpu_limit"])
self.fields[f"date_{project_name}"] = forms.DateField(label='date',initial=kwargs["projects"][i]["date"],widget=forms.DateInput(format="%Y-%m-%d", attrs={"type": "date"}),
input_formats=["%d-%m-%Y"])
input_formats=["%Y-%m-%d"])

self.fields[f"conda_{project_name}"] = forms.FileField(label='conda',initial=kwargs["projects"][i]["conda"])
self.fields[f"cluster_{project_name}"] = forms.ChoiceField(choices=clusters, label='cluster',initial=kwargs["projects"][i]["cluster"])
Expand Down

0 comments on commit 4e41a09

Please sign in to comment.