umbraco-community / umbraco-analytics

Google Analytics for the Umbraco CMS
41 stars 31 forks source link

Date(range)picker broken in Umbraco 7.4 #45

Open Bl0kkie opened 8 years ago

Bl0kkie commented 8 years ago

The datepicker (for picking a range) in all dataviews are broken at this moment.

hyrmedia commented 8 years ago

I can confirm that this is true for me as well. Clicking the datepicker button does nothing.

When reloading the Analytics > Views page, Chrome records the following error in the console:

angular.min.js?cdv=890644410:63 TypeError: Cannot read property '_weekdaysMin' of undefined
at new DateRangePicker (http://umbraco-dev.netdocuments.com/App_Plugins/UmbracoForms/Assets/daterangepicker/daterangepicker.js?cdv=890644410:45:39)
at HTMLDivElement.<anonymous> (http://umbraco-dev.netdocuments.com/App_Plugins/UmbracoForms/Assets/daterangepicker/daterangepicker.js?cdv=890644410:871:44)
at Function.x.extend.each (http://umbraco-dev.netdocuments.com/umbraco/lib/jquery/jquery.min.js?cdv=890644410:4:4575)
at x.fn.x.each (http://umbraco-dev.netdocuments.com/umbraco/lib/jquery/jquery.min.js?cdv=890644410:4:1626)
at $.fn.daterangepicker (http://umbraco-dev.netdocuments.com/App_Plugins/UmbracoForms/Assets/daterangepicker/daterangepicker.js?cdv=890644410:868:14)
at HTMLDocument.<anonymous> (http://umbraco-dev.netdocuments.com/App_Plugins/Analytics/backoffice/analyticstree/directives/daterangepicker.directive.js?cdv=890644410:12:25)
at l (http://umbraco-dev.netdocuments.com/umbraco/lib/jquery/jquery.min.js?cdv=890644410:4:24882)
at Object.c.add [as done] (http://umbraco-dev.netdocuments.com/umbraco/lib/jquery/jquery.min.js?cdv=890644410:4:25192)
at x.fn.x.ready (http://umbraco-dev.netdocuments.com/umbraco/lib/jquery/jquery.min.js?cdv=890644410:4:1685)
at x.fn.x.init (http://umbraco-dev.netdocuments.com/umbraco/lib/jquery/jquery.min.js?cdv=890644410:4:1243)  

<div ng-model="dateFilter" date-range-picker="" class="date-filter pull-right ng-isolate-scope ng-scope ng-pristine ng-valid">

Hope this helps..

KirschnerMatt commented 8 years ago

I'm getting the same error on 7.4.3

KirschnerMatt commented 8 years ago

Why is the package trying to pull the daterangepicker js file from Umbraco Forms? I wonder if there's a conflict between Analytics and the Umbraco Forms package.

jdcuster commented 7 years ago

Has anyone found a fix to this they can share? If not, I'll start working on it as time permits.

jdcuster commented 7 years ago

I found the fix for this issue. The issue is in the daterangepicker.js file: https://github.com/warrenbuckley/Analytics/blob/develop/Analytics/App_Plugins/Analytics/lib/daterangepicker/daterangepicker.js#L45

Replace lines 45 and 46 with the following:

daysOfWeek: moment.weekdaysMin(), monthNames: moment.monthsShort(),

I'll add this to a new PR shortly.

warrenbuckley commented 7 years ago

I need to sit down tomorrow or tonight if (time allows) to test & verify this works as expected. Moment JS, date formats & locales along with some similar conflicts I had with this datepicker in the Forms codebase & the version of MomentJS in Umbraco core.

So will need a few different checks before I pull in the PR @jdcuster

jdcuster commented 7 years ago

Sounds good. It was tested with 7.5.6. This was the first version I tried the package with but it seems datepicker hasn't been working correctly since 7.4 so I assumed the issue was the result of a moment.js update in the core.

Either way - let me know if I can help with anything.

edgarJakob commented 7 years ago

I tried the fix but it did not work for me. Any news on this issue?

jdcuster commented 7 years ago

@edgarJakob - sorry just seeing this now - but did you do a cache flush to see if that worked?

edgarJakob commented 7 years ago

Thanks Joel, its working now.

Cheers

Gesendet von meinem Windows 10 Phone

Von: Joel Custermailto:notifications@github.com Gesendet: Freitag, 7. Juli 2017 20:13 An: warrenbuckley/Analyticsmailto:Analytics@noreply.github.com Cc: Edgar Rasquinmailto:edgar@rasquin.net; Mentionmailto:mention@noreply.github.com Betreff: Re: [warrenbuckley/Analytics] Date(range)picker broken in Umbraco 7.4 (#45)

@edgarJakobhttps://github.com/edgarjakob - sorry just seeing this now - but did you do a cache flush to see if that worked?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHubhttps://github.com/warrenbuckley/Analytics/issues/45#issuecomment-313755212, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AYNVxkYOcLT3-HRDdD_UZ7XiIbhGoU3pks5sLnVVgaJpZM4HaeF2.

jonnyflano commented 7 years ago

Thanks guys. I had this date picker issue also but found I needed to install the "Diplo DateRange Picker (V1.2)" package also.

robgha01 commented 6 years ago

@warrenbuckley Hey, i fixed and tested the issue heres the pull request: https://github.com/warrenbuckley/Analytics/pull/59

according to this https://github.com/mindblaze/foundation-daterangepicker/issues/3 thay changed it.