Skip to content

Commit

Permalink
Fixed DST issue, Month View height issue on IE
Browse files Browse the repository at this point in the history
Fixed DST issue - because of DST, some days were appearing twice/ month
appring twice or month skipped entirely.

Fixed issue of Month View height on IE.
  • Loading branch information
nehakadam committed Sep 13, 2016
1 parent feeba3c commit 50feca1
Show file tree
Hide file tree
Showing 65 changed files with 3,774 additions and 3,495 deletions.
9 changes: 8 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,14 @@ module.exports = function(grunt)

],

sAJSCustom = [],
sAJSCustom = [
'src/calenstyle-core.js',
'src/calenstyle-monthview.js',
'src/calenstyle-detailview.js',
'src/calenstyle-agendaview.js',
'src/calenstyle-quickagendaview.js',
'src/calenstyle-pickers.js'
],

sACSS = [

Expand Down
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "calenstyle",

"version": "2.0.3",
"version": "2.0.4",

"license" : "See License Information in LICENSE file",

Expand Down
2 changes: 1 addition & 1 deletion demo/CalExample-Filter.htm
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@
});
},

dayClicked: function(dSelectedDate, pClickedAt)
cellClicked: function(sView, dSelectedDate, bIsAllDay, pClickedAt)
{
console.log(dSelectedDate);
console.log(pClickedAt);
Expand Down
6 changes: 3 additions & 3 deletions demo/CalExampleAddEventOnViewClick.htm
Original file line number Diff line number Diff line change
Expand Up @@ -130,10 +130,10 @@
//calObj1.revertToOriginalEvent(oDraggedEvent, startDateBeforeDrop, endDateBeforeDrop);
},

dayClicked: function(selectedDate, pClickedAt)
cellClicked: function(sView, dSelectedDate, bIsAllDay, pClickedAt)
{
console.log("Day Clicked : " + selectedDate);
showModal(true, selectedDate);
console.log("Cell Clicked : " + dSelectedDate);
showModal(true, dSelectedDate);
},

cellClicked: function(selectedDateTime, pClickedAt)
Expand Down
2 changes: 1 addition & 1 deletion demo/CalExampleCustom-Header2.htm
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@

$(".calendarContOuter").CalenStyle(
{

headerSectionsList:
{
left: ["DatePickerIcon", "FullscreenButton"],
Expand Down
4 changes: 2 additions & 2 deletions demo/CalExampleCustom-NoHeader.htm
Original file line number Diff line number Diff line change
Expand Up @@ -357,9 +357,9 @@
oCal2.highlightDatesInDatePicker(dCal2Highlight);
},

dayClicked: function(selectedDate, pClickedAt)
cellClicked: function(sView, dSelectedDateTime, bIsAllDay, pClickedAt)
{
oCal1.setting.selectedDate = selectedDate;
oCal1.setting.selectedDate = dSelectedDateTime;
oCal1.reloadData();
oCal2.highlightDatesInDatePicker(oCal1.getVisibleDates());

Expand Down
5 changes: 3 additions & 2 deletions demo/CalExampleDefault.htm
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
/* --------------- Required --------------- */
.calendarContOuter
{
width: 1000px;
width: 100%;
/*width: 1000px;*/
height: 600px;
margin: 0px auto;

Expand All @@ -40,7 +41,7 @@
$(".calendarContOuter").CalenStyle(
{
/* --------------- Required --------------- */

eventIndicatorInDatePicker: "Dot",

calDataSource:
Expand Down
6 changes: 3 additions & 3 deletions demo/CalExampleDefaultViewWithDatePicker.htm
Original file line number Diff line number Diff line change
Expand Up @@ -253,14 +253,14 @@
oCal2.highlightDatesInDatePicker(dCal2Highlight);
},

dayClicked: function(selectedDate, pClickedAt)
cellClicked: function(sView, dSelectedDate, bIsAllDay, pClickedAt)
{
oCal1.setting.selectedDate = selectedDate;
oCal1.setting.selectedDate = dSelectedDate;
oCal1.reloadData();
oCal2.reloadData();
//oCal2.highlightDatesInDatePicker(oCal1.getVisibleDates());

oCal3.setting.selectedDate = selectedDate;
oCal3.setting.selectedDate = dSelectedDate;
oCal3.tv.oAEvents = oCal1.tv.oAEvents;
oCal3.setting.selectedDate = oCal1.tv.dVSDt;
oCal3.setting.daysInAgendaView = oCal1.tv.iNoVDay;
Expand Down
6 changes: 3 additions & 3 deletions demo/CalExampleDynamic.htm
Original file line number Diff line number Diff line change
Expand Up @@ -104,12 +104,12 @@
};

displayCalendarBasedOnWidth();
adjustList();
oAdjustList();

$(window).resize(function()
{
displayCalendarBasedOnWidth();
adjustList();
oAdjustList();
});

function displayCalendarBasedOnWidth()
Expand Down Expand Up @@ -192,7 +192,7 @@

setTimeout(function()
{
adjustList();
oAdjustList();
}, 0);

});
Expand Down
4 changes: 2 additions & 2 deletions demo/CalExampleExcludeNonBusinessHours.htm
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,9 @@
//calObj1.revertToOriginalEvent(oDraggedEvent, startDateBeforeDrop, endDateBeforeDrop);
},

dayClicked: function(selectedDate, pClickedAt)
cellClicked: function(sView, dSelectedDate, bIsAllDay, pClickedAt)
{
console.log("Day Clicked : " + selectedDate);
console.log("Cell Clicked : " + dSelectedDate);
}

});
Expand Down
4 changes: 2 additions & 2 deletions demo/CalExampleFullscreen.htm
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,9 @@
//calObj1.revertToOriginalEvent(oDraggedEvent, startDateBeforeDrop, endDateBeforeDrop);
},

dayClicked: function(selectedDate, pClickedAt)
cellClicked: function(sView, dSelectedDate, bIsAllDay, pClickedAt)
{
console.log("Day Clicked : " + selectedDate);
console.log("Cell Clicked : " + dSelectedDate);
}

});
Expand Down
4 changes: 2 additions & 2 deletions demo/CalExampleInternationalization.htm
Original file line number Diff line number Diff line change
Expand Up @@ -179,9 +179,9 @@
//calObj1.revertToOriginalEvent(oDraggedEvent, startDateBeforeDrop, endDateBeforeDrop);
},

dayClicked: function(selectedDate, pClickedAt)
cellClicked: function(sView, dSelectedDate, bIsAllDay, pClickedAt)
{
console.log("Day Clicked : " + selectedDate);
console.log("Cell Clicked : " + dSelectedDate);
}

});
Expand Down
2 changes: 1 addition & 1 deletion demo/Data-JSON.htm
Original file line number Diff line number Diff line change
Expand Up @@ -127,4 +127,4 @@

</body>

</html>
</html>
4 changes: 2 additions & 2 deletions demo/Mobile/CalExampleActionBarMobile.htm
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,9 @@
adjustList();
},

dayClicked: function(selectedDate, pClickedAt)
cellClicked: function(sView, dSelectedDate, bIsAllDay, pClickedAt)
{
console.log("Day Clicked : " + selectedDate);
console.log("Cell Clicked : " + dSelectedDate);
},

eventClicked: function()
Expand Down
4 changes: 2 additions & 2 deletions demo/Mobile/CalExampleMonthEventListMobile.htm
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,9 @@
adjustList();
},

dayClicked: function(selectedDate, pClickedAt)
cellClicked: function(sView, dSelectedDate, bIsAllDay, pClickedAt)
{
console.log("Day Clicked : " + selectedDate);
console.log("Cell Clicked : " + dSelectedDate);
},

eventClicked: function()
Expand Down
31 changes: 16 additions & 15 deletions demo/Mobile/ionic/config.xml
Original file line number Diff line number Diff line change
@@ -1,20 +1,21 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?xml version='1.0' encoding='utf-8'?>
<widget id="com.ionicframework.csexample766484" version="0.0.1" xmlns="http://www.w3.org/ns/widgets" xmlns:cdv="http://cordova.apache.org/ns/1.0">
<name>cs_example</name>
<description>
<name>cs_example</name>
<description>
An Ionic Framework and Cordova project.
</description>
<author email="[email protected]" href="http://example.com.com/">
<author email="[email protected]" href="http://example.com.com/">
Your Name Here
</author>
<content src="index.html"/>
<access origin="*"/>
<preference name="webviewbounce" value="false"/>
<preference name="UIWebViewBounce" value="false"/>
<preference name="DisallowOverscroll" value="true"/>
<preference name="android-minSdkVersion" value="16"/>
<preference name="BackupWebStorage" value="none"/>
<feature name="StatusBar">
<param name="ios-package" value="CDVStatusBar" onload="true"/>
</feature>
</widget>
<content src="index.html" />
<access origin="*" />
<preference name="webviewbounce" value="false" />
<preference name="UIWebViewBounce" value="false" />
<preference name="DisallowOverscroll" value="true" />
<preference name="android-minSdkVersion" value="16" />
<preference name="BackupWebStorage" value="none" />
<feature name="StatusBar">
<param name="ios-package" onload="true" value="CDVStatusBar" />
</feature>
<engine name="android" spec="~5.1.1" />
</widget>
2 changes: 2 additions & 0 deletions demo/QuickUse-Default.htm
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@
{
/* --------------- Required --------------- */

fixedNumOfWeeksInMonthView: true,

calDataSource:
[
{
Expand Down
2 changes: 1 addition & 1 deletion dist/calenstyle-agendaview.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
CalenStyle - Responsive Event Calendar
Version 2.0.3
Version 2.0.4
Copyright (c)2016 Curious Solutions LLP
https://curioussolutions.in/libraries/calenstyle/content/license.htm
See License Information in LICENSE file.
Expand Down
2 changes: 1 addition & 1 deletion dist/calenstyle-appointmentview.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
CalenStyle - Responsive Event Calendar
Version 2.0.3
Version 2.0.4
Copyright (c)2016 Curious Solutions LLP
https://curioussolutions.in/libraries/calenstyle/content/license.htm
See License Information in LICENSE file.
Expand Down
29 changes: 24 additions & 5 deletions dist/calenstyle-core.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
CalenStyle - Responsive Event Calendar
Version 2.0.3
Version 2.0.4
Copyright (c)2016 Curious Solutions LLP
https://curioussolutions.in/libraries/calenstyle/content/license.htm
See License Information in LICENSE file.
Expand Down Expand Up @@ -2464,10 +2464,15 @@ CalenStyle.prototype = {
iCalendarContWidth = $occCalendarContInner.outerWidth(),
iCalendarContHeight = $occCalendarContInner.outerHeight();

// if(iCalendarContWidth > 410 || iCalendarContHeight > 410)
// $(to.elem).find(".cContHeader, .cContHeaderSections, .cContHeaderDatePickerIcon, .cContHeaderFullscreen, .cContHeaderNavButton").css({"height": 45, "line-height": 45+"px"});
// else
// $(to.elem).find(".cContHeader, .cContHeaderSections, .cContHeaderDatePickerIcon, .cContHeaderFullscreen, .cContHeaderNavButton").css({"height": 45, "line-height": 45+"px"});

if(iCalendarContWidth > 410 || iCalendarContHeight > 410)
$(to.elem).find(".cContHeader, .cContHeaderSections, .cContHeaderDatePickerIcon, .cContHeaderFullscreen, .cContHeaderNavButton").css({"height": 45, "line-height": 45+"px"});
$(to.elem).find(".cContHeader, .cContHeaderDatePickerIcon, .cContHeaderFullscreen, .cContHeaderNavButton").css({"height": 45, "line-height": 45+"px"});
else
$(to.elem).find(".cContHeader, .cContHeaderSections, .cContHeaderDatePickerIcon, .cContHeaderFullscreen, .cContHeaderNavButton").css({"height": 45, "line-height": 45+"px"});
$(to.elem).find(".cContHeader, .cContHeaderDatePickerIcon, .cContHeaderFullscreen, .cContHeaderNavButton").css({"height": 45, "line-height": 45+"px"});
},

//--------------------------------- Header Related Functions End ---------------------------------
Expand Down Expand Up @@ -3159,7 +3164,10 @@ CalenStyle.prototype = {
if(sDateType === "[object Date]")
dTempDate = (bIsAllDay ? to.convertToUTC(sDate, sIpTZOffset) : to.normalizeDateTimeWithOffset(sDate, sIpTZOffset, to.setting.outputTZOffset));
else if(sDateType === "[object Number]")
dTempDate = (bIsAllDay ? to.convertToUTC(new Date(sDate), sIpTZOffset) : to.normalizeDateTimeWithOffset(new Date(sDate), sIpTZOffset, to.setting.outputTZOffset));
{
// dTempDate = (bIsAllDay ? to.convertToUTC(new Date(sDate), sIpTZOffset) : to.normalizeDateTimeWithOffset(new Date(sDate), sIpTZOffset, to.setting.outputTZOffset));
dTempDate = (bIsAllDay ? to.convertToUTC(new Date(sDate), "+00:00") : to.normalizeDateTimeWithOffset(new Date(sDate), "+00:00", to.setting.outputTZOffset));
}
else
{
var iDay = 0, iMonth = 0, iYear = 0, iHours = 0, iMinutes = 0, iSeconds = 0;
Expand Down Expand Up @@ -3367,14 +3375,19 @@ CalenStyle.prototype = {

to.tv.dVSDt = to.setDateInFormat({"date": to._getWeekForDate(dMonthStartDate, false)[0]}, "START");
if(!to.setting.fixedNumOfWeeksInMonthView)
to.tv.iWkInMonth = ((to._getWeekForDate(dMonthEndDate, false)[0].getTime() - to.tv.dVSDt.getTime())/$.CalenStyle.extra.iMS.w) + 1;
to.tv.iWkInMonth = Math.round((to._getWeekForDate(dMonthEndDate, false)[0].getTime() - to.tv.dVSDt.getTime())/$.CalenStyle.extra.iMS.w) + 1;

to.tv.iNoVDay = 0;
var iDateMS = to.tv.dVSDt.getTime(),
iNumMonthDays = (to.setting.excludeNonBusinessHours) ? (to.tv.iBsDays * to.tv.iWkInMonth) : (7 * to.tv.iWkInMonth);
var iStartTZOffset = to.tv.dVSDt.getTimezoneOffset();
for(var iTempIndex = 0; iTempIndex < (7 * to.tv.iWkInMonth); iTempIndex++)
{
var dTempDate = new Date(iDateMS);
var iThisTZOffset = dTempDate.getTimezoneOffset();
if(iStartTZOffset !== iThisTZOffset)
dTempDate = new Date(iDateMS + ((iThisTZOffset - iStartTZOffset) * $.CalenStyle.extra.iMS.m));

if(!to.setting.excludeNonBusinessHours)
{
to.tv.dAVDt.push(dTempDate);
Expand Down Expand Up @@ -3604,9 +3617,15 @@ CalenStyle.prototype = {
var to = this;
var iDVDateMS = dStartDate.getTime(),
oArrDates = [];

var iStartTZOffset = dStartDate.getTimezoneOffset();
for(var iDateIndex = 0; iDateIndex < iNoOfDays; iDateIndex++)
{
var dTempDate = new Date(iDVDateMS);
var iThisTZOffset = dTempDate.getTimezoneOffset();
if(iStartTZOffset !== iThisTZOffset)
dTempDate = new Date(iDVDateMS + ((iThisTZOffset - iStartTZOffset) * $.CalenStyle.extra.iMS.m));

//if(dEndDate !== null && to.compareDates(dTempDate, dEndDate) === 0)
// break;

Expand Down
Loading

0 comments on commit 50feca1

Please sign in to comment.