You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm having two issues with the same aspect of my application, the abstract view is this:
The app allows users to view different video clips. On the back-end/admin section the admin can track the views of any particular group of clips. For example, the admin can choose Universal Studios, select a date range: Beginning Date: 2015-01-1, End Date: 2016-01-1 and hit filter, and see the number of total views that Universal received within this range.
The problem is, for one, datepicker is no longer working, so when I click on the date fields, no calendar appears, I manually have to type in the date. And for two, I'm only getting results between furthest: 2015-10-18 and 2016-02-18. When I type in 2015-09-18 or anything earlier it doesn't generate results.
Below is the error when I click inspect element in Chorme,
error: Uncaught TypeError: Cannot read property 'apply' of undefined
*/
(function($) {
var _datepicker = jQuery.fn.datepicker;
$.fn.datepicker = function(options) {
var $date = _datepicker.apply(this, arguments); <--- this line
application.js requires
// This is a manifest file that'll be compiled into including all the files listed below.
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
// be included in the compiled file accessible from http://example.com/assets/application.js
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
// the compiled file.
//
//= require jquery
//= require jquery_ujs
//= require jquery-ui/draggable
//= require jquery-ui/sortable
//= require jquery-ui/autocomplete
//= require bootstrap
//= require carousel.js
//= require hover.js
//= require menu_js/modernizr.js
//= require menu_js/dlmenu.js
//= require custom.js
//= require bootstrap-tabs.js
//= require jquery.raty.js
//= require letsrate.js
//= require rails-timeago
//= require tinymce-jquery
//= require scrollTo.js
//= require clips.js
//= require jquery.sticky.js
//= require jquery-ui.min.js
//= require jquery.dynatable.js
//= require playlist.js
//= require index.js.coffee
custom.js
/**
* Constructor patch for jQuery UI DatePicker
* Automatically initializes the input with the value from the altField
*/
(function($) {
var _datepicker = jQuery.fn.datepicker;
$.fn.datepicker = function(options) {
var $date = _datepicker.apply(this, arguments);
if (options.altFormat && options.altField) {
var altValue = $(options.altField).val();
var value = $.datepicker.parseDate(options.altFormat, altValue);
var dateFormat = _datepicker.call(this, 'option', 'dateFormat');
$(this).val($.datepicker.formatDate(dateFormat, value));
}
};
})(jQuery);
var $date = $("#search_start_date");
$date.datepicker({
dateFormat: "yy-mm-dd",
altFormat: "yymmdd"
});
var $end_date = $('#search_end_date');
$end_date.datepicker({
dateFormat: "yy-mm-dd",
altFormat: "yymmdd"
});
});
I'm having two issues with the same aspect of my application, the abstract view is this:
The app allows users to view different video clips. On the back-end/admin section the admin can track the views of any particular group of clips. For example, the admin can choose
Universal Studios
, select adate range: Beginning Date: 2015-01-1, End Date: 2016-01-1
and hitfilter
, and see the number of total views thatUniversal
received within this range.The problem is, for one, datepicker is no longer working, so when I click on the date fields, no calendar appears, I manually have to type in the date. And for two, I'm only getting results between furthest:
2015-10-18
and2016-02-18
. When I type in2015-09-18
or anything earlier it doesn't generate results.Below is the error when I click inspect element in Chorme,
error: Uncaught TypeError: Cannot read property 'apply' of undefined
application.js requires
custom.js
index.html.erb
The text was updated successfully, but these errors were encountered: