ionic2-calendar
Advanced tools
Comparing version 0.3.14 to 0.3.15
@@ -134,7 +134,15 @@ import { DatePipe } from '@angular/common'; | ||
DayViewComponent.createDateObjects = function (startTime, startHour, endHour, timeInterval) { | ||
var rows = [], time, currentHour = startTime.getHours(), currentDate = startTime.getDate(); | ||
for (var hour = startHour; hour < endHour; hour += 1) { | ||
for (var interval = 0; interval < timeInterval; interval += 1) { | ||
var rows = [], time, currentHour = startTime.getHours(), currentDate = startTime.getDate(), hourStep, minStep; | ||
if (timeInterval < 1) { | ||
hourStep = Math.floor(1 / timeInterval); | ||
minStep = 60; | ||
} | ||
else { | ||
hourStep = 1; | ||
minStep = Math.floor(60 / timeInterval); | ||
} | ||
for (var hour = startHour; hour < endHour; hour += hourStep) { | ||
for (var interval = 0; interval < 60; interval += minStep) { | ||
time = new Date(startTime.getTime()); | ||
time.setHours(currentHour + hour, 60 * interval / timeInterval); | ||
time.setHours(currentHour + hour, interval); | ||
time.setDate(currentDate); | ||
@@ -141,0 +149,0 @@ rows.push({ |
{ | ||
"name": "ionic2-calendar", | ||
"version": "0.3.14", | ||
"version": "0.3.15", | ||
"description": "Ionic2 calendar component", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -140,9 +140,17 @@ import { DatePipe } from '@angular/common'; | ||
WeekViewComponent.createDateObjects = function (startTime, startHour, endHour, timeInterval) { | ||
var times = [], currentHour = startTime.getHours(), currentDate = startTime.getDate(); | ||
for (var hour = startHour; hour < endHour; hour += 1) { | ||
for (var interval = 0; interval < timeInterval; interval += 1) { | ||
var times = [], currentHour = startTime.getHours(), currentDate = startTime.getDate(), hourStep, minStep; | ||
if (timeInterval < 1) { | ||
hourStep = Math.floor(1 / timeInterval); | ||
minStep = 60; | ||
} | ||
else { | ||
hourStep = 1; | ||
minStep = Math.floor(60 / timeInterval); | ||
} | ||
for (var hour = startHour; hour < endHour; hour += hourStep) { | ||
for (var interval = 0; interval < 60; interval += minStep) { | ||
var row = []; | ||
for (var day = 0; day < 7; day += 1) { | ||
var time = new Date(startTime.getTime()); | ||
time.setHours(currentHour + hour, 60 * interval / timeInterval); | ||
time.setHours(currentHour + hour, interval); | ||
time.setDate(currentDate + day); | ||
@@ -149,0 +157,0 @@ row.push({ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
890143
9143