zpaulovics / datetimepicker-rails

A date and time picker for Twitter Bootstrap in Rails using Simple Form
MIT License
174 stars 80 forks source link

Missing pickers.js file... #85

Open cbwilliamsnh opened 7 years ago

cbwilliamsnh commented 7 years ago

I followed the installation instructions and ran the generators but I'm missing the pickers.js file. Is this no longer needed?

Thank you, Chuck

zpaulovics commented 7 years ago

Hi,

Yes you need it.

Zoltan

On 2016.11 .22, at 17:58, Chuck Williams notifications@github.com wrote:

I followed the installation instructions and ran the generators but I'm missing the pickers.js file. Is this no longer needed?

Thank you, Chuck

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/zpaulovics/datetimepicker-rails/issues/85, or mute the thread https://github.com/notifications/unsubscribe-auth/AA19hORqPkUS6JXEzYlf_vuOZ9FGT4haks5rAx8jgaJpZM4K5rue.

cbwilliamsnh commented 7 years ago

ok, why didn't the generator create it and do you have one to send me?

Thanks, Chuck

On Tue, Nov 22, 2016 at 12:21 PM, Zoltan Paulovics <notifications@github.com

wrote:

Hi,

Yes you need it.

Zoltan

On 2016.11 .22, at 17:58, Chuck Williams notifications@github.com wrote:

I followed the installation instructions and ran the generators but I'm missing the pickers.js file. Is this no longer needed?

Thank you, Chuck

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ zpaulovics/datetimepicker-rails/issues/85, or mute the thread < https://github.com/notifications/unsubscribe-auth/AA19hORqPkUS6JXEzYlf_ vuOZ9FGT4haks5rAx8jgaJpZM4K5rue>.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/zpaulovics/datetimepicker-rails/issues/85#issuecomment-262305347, or mute the thread https://github.com/notifications/unsubscribe-auth/AHotk-wpmWn4UDQjHhMmKjBp1I1izkbLks5rAySVgaJpZM4K5rue .

Chuck

cbwilliamsnh commented 7 years ago

Zoltan,

Something is definitely missing. I have two date_picker fields and as you can see, the calendars are part of the page, not as a pop-up when selecting either input field.

Here's the form:

<%= simple_form_for(@asset) do |f| %> <%= f.error_notification %>

<%= f.input :epc %> <%= f.input :name %> <%= f.input :description %> <%= f.input :serial_number %> <%= f.input :last_maintenance_date, as: :date_picker %> <%= f.input :next_maintenance_date, as: :date_picker %> <%= f.input :maintenance_frequency %> <%= f.input :value %>
<%= f.button :submit %>

<% end %>

application.js:

// This is a manifest file that'll be compiled into application.js, which will include all the files // listed below. // // Any JavaScript/Coffee file within this directory, lib/assets/javascripts, vendor/assets/javascripts, // or vendor/assets/javascripts of plugins, if any, can be referenced here using a relative path. // // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the // compiled file. // // Read Sprockets README ( https://github.com/sstephenson/sprockets#sprockets-directives) for details // about supported directives. // //= require jquery //= require jquery_ujs //= require bootstrap //= require turbolinks //= require moment //= require bootstrap-datetimepicker //= require pickers //= require_tree .

application.css.scss:

/*

and what I currently have in pickers.js that I copied from the main github page:

$(document).on('ready page:change', function() { $('.datetimepicker').datetimepicker({ // put here your custom picker options, that should be applied for all pickers });

$('.datetimerange').each(function(){ var $this = $(this) var range1 = $($this.find('.input-group')[0]) var range2 = $($this.find('.input-group')[1])

if(range1.data("DateTimePicker").date() != null)

range2.data("DateTimePicker").minDate(range1.data("DateTimePicker").date());

if(range2.data("DateTimePicker").date() != null)

range1.data("DateTimePicker").maxDate(range2.data("DateTimePicker").date());

range1.on("dp.change",function (e) {
  if(e.date)
    range2.data("DateTimePicker").minDate(e.date);
  else
    range2.data("DateTimePicker").minDate(false);
});

range2.on("dp.change",function (e) {
  if(e.date)
    range1.data("DateTimePicker").maxDate(e.date);
  else
    range1.data("DateTimePicker").maxDate(false);
});

}) });

I'm sure that's the culprit. Can you send me pickers.js?

[image: Inline image 1]

On Tue, Nov 22, 2016 at 12:34 PM, Chuck Williams cbwilliamsva@gmail.com wrote:

ok, why didn't the generator create it and do you have one to send me?

Thanks, Chuck

On Tue, Nov 22, 2016 at 12:21 PM, Zoltan Paulovics < notifications@github.com> wrote:

Hi,

Yes you need it.

Zoltan

On 2016.11 .22, at 17:58, Chuck Williams notifications@github.com wrote:

I followed the installation instructions and ran the generators but I'm missing the pickers.js file. Is this no longer needed?

Thank you, Chuck

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub < https://github.com/zpaulovics/datetimepicker-rails/issues/85>, or mute the thread https://github.com/notifications/unsubscribe-auth/ AA19hORqPkUS6JXEzYlf_vuOZ9FGT4haks5rAx8jgaJpZM4K5rue.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/zpaulovics/datetimepicker-rails/issues/85#issuecomment-262305347, or mute the thread https://github.com/notifications/unsubscribe-auth/AHotk-wpmWn4UDQjHhMmKjBp1I1izkbLks5rAySVgaJpZM4K5rue .

Chuck

Chuck

cbwilliamsnh commented 7 years ago

Ok, pretty sure I now have the right pickers.js file in the right place, but still seeing the behavior noted in the screenshot above.

Thanks, Chuck

cbwilliamsnh commented 7 years ago

ok, so I found my first error. Seems I copied the gem line for the 1.0.0 version. That's fixed. Reran the generator and have a proper pickers.js file, but I still don't have an icon in my simple_form and the picker pop-up isn't popping up.

The static calendars at the bottom of the page are now gone.

Still missing something... any help is greatly appreciated.

Chuck