summaryrefslogtreecommitdiffstats
path: root/apps/calendar/ajax/neweventform.php
diff options
context:
space:
mode:
authorGeorg Ehrke <georg.stefan.germany@googlemail.com>2011-09-28 23:28:14 +0200
committerGeorg Ehrke <georg.stefan.germany@googlemail.com>2011-09-28 23:28:14 +0200
commit8c405a59d80898b56e411f40bfb07456f910cc49 (patch)
tree198e205edd71fc6b03cf7c1b4cb4f9ff2bb4177d /apps/calendar/ajax/neweventform.php
parent61aa00899d33a3b9706cf321555405fedf044775 (diff)
downloadnextcloud-server-8c405a59d80898b56e411f40bfb07456f910cc49.tar.gz
nextcloud-server-8c405a59d80898b56e411f40bfb07456f910cc49.zip
little bug fixes in calendar app
Diffstat (limited to 'apps/calendar/ajax/neweventform.php')
-rw-r--r--apps/calendar/ajax/neweventform.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/apps/calendar/ajax/neweventform.php b/apps/calendar/ajax/neweventform.php
index 7a4c6f469e5..7099ea718e9 100644
--- a/apps/calendar/ajax/neweventform.php
+++ b/apps/calendar/ajax/neweventform.php
@@ -29,6 +29,9 @@ if($starttime != 'undefined' && !is_nan($starttime) && !$allday){
$startminutes = '00';
}else{
$starttime = date('H');
+ if(strlen($starttime) == 2 && $starttime <= 9){
+ $starttime = substr($starttime, 1, 1);
+ }
$startminutes = date('i');
}
@@ -38,7 +41,18 @@ $endyear = $startyear;
$endtime = $starttime;
$endminutes = $startminutes;
if($endtime == 23) {
- $endday++;
+ if($startday == date(t, mktime($starttime, $startminutes, 0, $startmonth, $startday, $startyear))){
+ $datetimestamp = mktime(0, 0, 0, $startmonth, $startday, $startyear);
+ $datetimestamp = $datetimestamp + 86400;
+ $endmonth = date("m", $datetimestamp);
+ $endday = date("d", $datetimestamp);
+ $endyear = date("Y", $datetimestamp);
+ }else{
+ $endday++;
+ if($endday <= 9){
+ $endday = "0" . $endday;
+ }
+ }
$endtime = 0;
} else {
$endtime++;