Closed complitech closed 9 years ago
You are right. The option you have used was valid with Version v1.0.0. The current call is:
$(document).on('ready page:change', function() {
$('.datetimepicker').datetimepicker({
// put here your custom picker options, that should be applied for all pickers
});
});
The valid options are (with their default values):
format: false,
dayViewHeaderFormat: 'MMMM YYYY',
extraFormats: false,
stepping: 1,
minDate: false,
maxDate: false,
useCurrent: true,
collapse: true,
locale: moment.locale(),
defaultDate: false,
disabledDates: false,
enabledDates: false,
icons: {
time: 'glyphicon glyphicon-time',
date: 'glyphicon glyphicon-calendar',
up: 'glyphicon glyphicon-chevron-up',
down: 'glyphicon glyphicon-chevron-down',
previous: 'glyphicon glyphicon-chevron-left',
next: 'glyphicon glyphicon-chevron-right',
today: 'glyphicon glyphicon-screenshot',
clear: 'glyphicon glyphicon-trash',
close: 'glyphicon glyphicon-remove'
},
useStrict: false,
sideBySide: false,
daysOfWeekDisabled: [],
calendarWeeks: false,
viewMode: 'days',
toolbarPlacement: 'default',
showTodayButton: false,
showClear: false,
showClose: false,
widgetPositioning: {
horizontal: 'auto',
vertical: 'auto'
},
widgetParent: null,
ignoreReadonly: false,
keepOpen: false,
focusOnShow: true,
inline: false,
keepInvalid: false,
datepickerInput: '.datepickerinput'
Zoltan
So, how can we pick just the date part and not time? Thanks!
Hi,
It is very simple. Just use the following SimpleForm example:
<%= simple_form_for @course, wrapper: :horizontal_form,
:html => { :class => 'form-horizontal' } do |f| %>
<%= f.error_notification %>
...
<%= f.input :start_date, as: :date_picker, :label => 'Start date' %>
<%= f.input :end_date, as: :date_picker, :label => 'End date' %>
<% end %>
Zoltan
It's working for me with the SimpleForm example :D
Uncaught TypeError: option pickTime is not recognized!