File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed
classes/Visualizer/Module Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -54,6 +54,7 @@ public function __construct( Visualizer_Plugin $plugin ) {
5454 parent ::__construct ( $ plugin );
5555
5656 $ this ->_addAction ( 'wp_enqueue_scripts ' , 'enqueueScripts ' );
57+ $ this ->_addAction ( 'load-index.php ' , 'enqueueScripts ' );
5758 $ this ->_addAction ( 'visualizer_enqueue_scripts ' , 'enqueueScripts ' );
5859 $ this ->_addFilter ( 'visualizer_get_language ' , 'getLanguage ' );
5960 $ this ->_addShortcode ( 'visualizer ' , 'renderChart ' );
Original file line number Diff line number Diff line change @@ -265,11 +265,15 @@ var __visualizer_chart_images = [];
265265 case 'date' :
266266 // fall-through.
267267 case 'datetime' :
268- var dateParse = Date . parse ( data [ i ] [ j ] . replace ( / - / g, '/' ) ) ;
269- if ( isNaN ( dateParse ) ) {
270- dateParse = Date . parse ( data [ i ] [ j ] ) ;
268+ if ( typeof data [ i ] [ j ] === 'string' ) {
269+ var dateParse = Date . parse ( data [ i ] [ j ] . replace ( / - / g, '/' ) ) ;
270+ if ( isNaN ( dateParse ) ) {
271+ dateParse = Date . parse ( data [ i ] [ j ] ) ;
272+ }
273+ date = new Date ( dateParse ) ;
274+ } else if ( typeof data [ i ] [ j ] === 'object' ) {
275+ date = data [ i ] [ j ] ;
271276 }
272- date = new Date ( dateParse ) ;
273277 data [ i ] [ j ] = null ;
274278 if ( Object . prototype . toString . call ( date ) === "[object Date]" ) {
275279 if ( ! isNaN ( date . getTime ( ) ) ) {
You can’t perform that action at this time.
0 commit comments