CLNDR Events Not Passing to Dot Template for Safari
I am using https://kylestetz.github.io/CLNDR/ with a http://olado.github.io/ template, and the events array doesn't appear to be returning for Safari and Firefox browsers. I verified this using console.log(day), and the events array is empty for these browsers only. Chrome works perfectly though.
Here is my DOT template:
<script id="dot-template" type="text/template">
<div id="clndr-3">
<div class="clndr-grid">
<div class="days-of-the-week">
<div class="days">
{{~it.days :day:index}}
{{? day.events.length }}
<a href="{{= day.events[0].url }}">
<div class="{{= day.classes }}">{{= day.day }}</div>
</a>
{{??}}
<div class="{{= day.classes }}">{{= day.day }}</div>
{{?}}
{{~}}
</div>
</div>
</div>
</div>
</script>
Here is my JS:
<script type="text/javascript">
jQuery(document).ready(function($){
let clndrTemplate = doT.template($('#dot-template').html()),
events = <?= json_encode($calendar_array); ?>,
let theCalendarInstance = jQuery('#clndr').clndr({
template: jQuery("#clndr-template"),
events: events,
render: function (data) {
return clndrTemplate(data);
},
});
});
</script>
My events array is building with PHP:
<?php
$calendar_array = array();
foreach( $events as $event ) :
$event_id = $event->ID;
$event_title = $event->post_title;
$event_date = tribe_get_start_date($event_id, false, 'l, F j, Y');
$calendar_array = array(
'date' => date('m-d-Y', strtotime($event_date)),
'title' => $event_title,
'url' => get_the_permalink($event_id)
);
endforeach;
?>
The calendar will initiate for all browsers, however, the events aren't being passed to the DOT template in Safari and Firefox.
php wordpress dot.js clndr.js
add a comment |
I am using https://kylestetz.github.io/CLNDR/ with a http://olado.github.io/ template, and the events array doesn't appear to be returning for Safari and Firefox browsers. I verified this using console.log(day), and the events array is empty for these browsers only. Chrome works perfectly though.
Here is my DOT template:
<script id="dot-template" type="text/template">
<div id="clndr-3">
<div class="clndr-grid">
<div class="days-of-the-week">
<div class="days">
{{~it.days :day:index}}
{{? day.events.length }}
<a href="{{= day.events[0].url }}">
<div class="{{= day.classes }}">{{= day.day }}</div>
</a>
{{??}}
<div class="{{= day.classes }}">{{= day.day }}</div>
{{?}}
{{~}}
</div>
</div>
</div>
</div>
</script>
Here is my JS:
<script type="text/javascript">
jQuery(document).ready(function($){
let clndrTemplate = doT.template($('#dot-template').html()),
events = <?= json_encode($calendar_array); ?>,
let theCalendarInstance = jQuery('#clndr').clndr({
template: jQuery("#clndr-template"),
events: events,
render: function (data) {
return clndrTemplate(data);
},
});
});
</script>
My events array is building with PHP:
<?php
$calendar_array = array();
foreach( $events as $event ) :
$event_id = $event->ID;
$event_title = $event->post_title;
$event_date = tribe_get_start_date($event_id, false, 'l, F j, Y');
$calendar_array = array(
'date' => date('m-d-Y', strtotime($event_date)),
'title' => $event_title,
'url' => get_the_permalink($event_id)
);
endforeach;
?>
The calendar will initiate for all browsers, however, the events aren't being passed to the DOT template in Safari and Firefox.
php wordpress dot.js clndr.js
add a comment |
I am using https://kylestetz.github.io/CLNDR/ with a http://olado.github.io/ template, and the events array doesn't appear to be returning for Safari and Firefox browsers. I verified this using console.log(day), and the events array is empty for these browsers only. Chrome works perfectly though.
Here is my DOT template:
<script id="dot-template" type="text/template">
<div id="clndr-3">
<div class="clndr-grid">
<div class="days-of-the-week">
<div class="days">
{{~it.days :day:index}}
{{? day.events.length }}
<a href="{{= day.events[0].url }}">
<div class="{{= day.classes }}">{{= day.day }}</div>
</a>
{{??}}
<div class="{{= day.classes }}">{{= day.day }}</div>
{{?}}
{{~}}
</div>
</div>
</div>
</div>
</script>
Here is my JS:
<script type="text/javascript">
jQuery(document).ready(function($){
let clndrTemplate = doT.template($('#dot-template').html()),
events = <?= json_encode($calendar_array); ?>,
let theCalendarInstance = jQuery('#clndr').clndr({
template: jQuery("#clndr-template"),
events: events,
render: function (data) {
return clndrTemplate(data);
},
});
});
</script>
My events array is building with PHP:
<?php
$calendar_array = array();
foreach( $events as $event ) :
$event_id = $event->ID;
$event_title = $event->post_title;
$event_date = tribe_get_start_date($event_id, false, 'l, F j, Y');
$calendar_array = array(
'date' => date('m-d-Y', strtotime($event_date)),
'title' => $event_title,
'url' => get_the_permalink($event_id)
);
endforeach;
?>
The calendar will initiate for all browsers, however, the events aren't being passed to the DOT template in Safari and Firefox.
php wordpress dot.js clndr.js
I am using https://kylestetz.github.io/CLNDR/ with a http://olado.github.io/ template, and the events array doesn't appear to be returning for Safari and Firefox browsers. I verified this using console.log(day), and the events array is empty for these browsers only. Chrome works perfectly though.
Here is my DOT template:
<script id="dot-template" type="text/template">
<div id="clndr-3">
<div class="clndr-grid">
<div class="days-of-the-week">
<div class="days">
{{~it.days :day:index}}
{{? day.events.length }}
<a href="{{= day.events[0].url }}">
<div class="{{= day.classes }}">{{= day.day }}</div>
</a>
{{??}}
<div class="{{= day.classes }}">{{= day.day }}</div>
{{?}}
{{~}}
</div>
</div>
</div>
</div>
</script>
Here is my JS:
<script type="text/javascript">
jQuery(document).ready(function($){
let clndrTemplate = doT.template($('#dot-template').html()),
events = <?= json_encode($calendar_array); ?>,
let theCalendarInstance = jQuery('#clndr').clndr({
template: jQuery("#clndr-template"),
events: events,
render: function (data) {
return clndrTemplate(data);
},
});
});
</script>
My events array is building with PHP:
<?php
$calendar_array = array();
foreach( $events as $event ) :
$event_id = $event->ID;
$event_title = $event->post_title;
$event_date = tribe_get_start_date($event_id, false, 'l, F j, Y');
$calendar_array = array(
'date' => date('m-d-Y', strtotime($event_date)),
'title' => $event_title,
'url' => get_the_permalink($event_id)
);
endforeach;
?>
The calendar will initiate for all browsers, however, the events aren't being passed to the DOT template in Safari and Firefox.
php wordpress dot.js clndr.js
php wordpress dot.js clndr.js
edited Nov 13 '18 at 19:52
Keith Petrillo
asked Nov 13 '18 at 19:04
Keith PetrilloKeith Petrillo
5111
5111
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53287883%2fclndr-events-not-passing-to-dot-template-for-safari%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53287883%2fclndr-events-not-passing-to-dot-template-for-safari%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown