Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script type='text/javascript'>
- $.noConflict();
- jQuery(document).ready(function() {
- tempValue = '{!$CurrentPage.parameters.startDate}';
- var userLang = UserContext.dateFormat;
- y='';
- d='';
- m='';
- console.log(userLang);
- if (userLang === "M/d/yyyy") {
- var dateTemp = tempValue.split("/");
- d1 = dateTemp[0];
- m1 = dateTemp[1];
- y1 = dateTemp[2];
- newDate = new Date(d1 + "/" + m1 + "/" + y1);
- d = newDate.getDate();
- m = newDate.getMonth();
- y = newDate.getFullYear();
- };
- if (userLang === "dd/MM/yyyy") {
- var dateTemp = tempValue.split("/");
- d1 = dateTemp[0];
- m1 = dateTemp[1];
- y1 = dateTemp[2];
- newDate = new Date(m1 + "/" + d1 + "/" + y1);
- d = newDate.getDate();
- m = newDate.getMonth();
- y = newDate.getFullYear();
- };
- if (userLang === "dd.MM.yyyy") {
- var dateTemp = tempValue.split(".");
- d1 = dateTemp[0];
- m1 = dateTemp[1];
- y1 = dateTemp[2];
- newDate = new Date(m1 + "/" + d1 + "/" + y1);
- d = newDate.getDate();
- m = newDate.getMonth();
- y = newDate.getFullYear();
- };
- //We need to wrap everything in a doc.ready function so that the code fires after the DOM is loaded
- //Call the fullCallendar method. You can replace the '#calendar' with the ID of the dom element where you want the calendar to go.
- jQuery('#calendar').fullCalendar({
- year: y,
- month: m,
- date: d,
- defaultView: 'agendaDay',
- slotMinutes: 15,
- header: {
- left: 'prev,next today',
- center: 'title',
- right: 'month,agendaWeek,agendaDay'
- },
- editable: false,
- events:
- [
- //At run time, this APEX Repeat will reneder the array elements for the events array
- <apex:repeat value="{!events}" var="e">//this is my list with variables
- {
- title: "{!e.title}",
- start: '{!e.startString}',
- end: '{!e.endString}',
- url: '{!e.url}',
- allDay: {!e.allDay},
- className: '{!e.className}',
- },
- </apex:repeat>
- ],
- eventRender: function(Calevent, element) {
- element.qtip({
- content: event.OwnerName__c //this is not working(
- });
- }
- });
- });
- </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement