File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed
src/bootstrap_datepicker_plus Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -14,8 +14,8 @@ class BasePickerInput(DateTimeBaseInput):
1414 """Base Date-Picker input class for widgets of this package."""
1515
1616 variant = WidgetVariant .date
17+ _date_format = "%Y-%m-%d"
1718 backend_date_format = "YYYY-MM-DD"
18- format_key = "DATE_INPUT_FORMATS"
1919 options : Optional [WidgetOptions ] = None
2020 template_name = "bootstrap_datepicker_plus/input.html"
2121
@@ -53,7 +53,7 @@ def __init__(
5353 self .options ,
5454 options ,
5555 )
56- super ().__init__ (attrs )
56+ super ().__init__ (attrs , self . _date_format )
5757
5858 def build_attrs (
5959 self , base_attrs : InputAttrs , extra_attrs : Optional [InputAttrs ] = None
Original file line number Diff line number Diff line change @@ -21,29 +21,29 @@ class TimePickerInput(BasePickerInput):
2121 """Widget to display a Time-Picker Calendar on a TimeField."""
2222
2323 variant = WidgetVariant .time
24+ _date_format = "%H:%M:%S"
2425 backend_date_format = "HH:mm:ss"
25- format_key = "TIME_INPUT_FORMATS"
2626
2727
2828class DateTimePickerInput (BasePickerInput ):
2929 """Widget to display a DateTime-Picker Calendar on a DateTimeField."""
3030
3131 variant = WidgetVariant .datetime
32+ _date_format = "%Y-%m-%d %H:%M:%S"
3233 backend_date_format = "YYYY-MM-DD HH:mm:ss"
33- format_key = "DATETIME_INPUT_FORMATS"
3434
3535
3636class MonthPickerInput (BasePickerInput ):
3737 """Widget to display a Month-Picker Calendar on a DateField."""
3838
3939 variant = WidgetVariant .month
40+ _date_format = "%Y-%m-%d"
4041 backend_date_format = "YYYY-MM-01"
41- format_key = "DATE_INPUT_FORMATS"
4242
4343
4444class YearPickerInput (BasePickerInput ):
4545 """Widget to display a Year-Picker Calendar on a DateField."""
4646
4747 variant = WidgetVariant .year
48+ _date_format = "%Y-%m-%d"
4849 backend_date_format = "YYYY-01-01"
49- format_key = "DATE_INPUT_FORMATS"
You can’t perform that action at this time.
0 commit comments