Open bartoszhernas opened 9 years ago
I had the same problem, I don't live 2 centuries ago!
This is a workaround that works for me. It blanks the header of the popout. At least you don't see a ridiculous date! In your css file:
.datetimepicker th {
visibility: hidden !important;
}
It leaves you with an empty header, probably with a bit more tweaking you can work round that in the css too.
Also having this issue. I'm not seeing how to differentiate the Date and Time pickers from the javascript to be able to avoid this.
After some digging,
widgets.py should be updated like so:
quoted_options = set([
'format',
'startDate',
'endDate',
'startView',
'minView',
'maxView',
'todayBtn',
'language',
'pickerPosition',
'viewSelect',
'initialDate',
'weekStart',
'minuteStep'
'daysOfWeekDisabled',
'formatViewType'
])
and
class TimeWidget(PickerWidgetMixin, TimeInput):
"""
TimeWidget is the corresponding widget for Time field, it renders only the time section of
datetime picker.
"""
format_name = 'TIME_INPUT_FORMATS'
glyphicon = 'glyphicon-time'
def __init__(self, attrs=None, options=None, usel10n=None, bootstrap_version=None):
if options is None:
options = {}
# Set the default options to show only the timepicker object
options['startView'] = options.get('startView', 1)
options['minView'] = options.get('minView', 0)
options['maxView'] = options.get('maxView', 1)
options['format'] = options.get('format', 'hh:ii')
options['formatViewType'] = 'time'
super(TimeWidget, self).__init__(attrs, options, usel10n, bootstrap_version)
I want to have only time picker, without date, but when using TimePicker, you can see date on the top
Is there any way to hide it?