diff --git a/calendar/inc/class.calendar_uiforms.inc.php b/calendar/inc/class.calendar_uiforms.inc.php
index 061f0a04f8..c7ac6308da 100644
--- a/calendar/inc/class.calendar_uiforms.inc.php
+++ b/calendar/inc/class.calendar_uiforms.inc.php
@@ -1920,6 +1920,16 @@ class calendar_uiforms extends calendar_ui
$response = egw_json_response::get();
//$response->addAlert(__METHOD__.'('.array2string($edit_content).')');
+ // convert start/end date-time values to timestamps
+ foreach(array('start', 'end') as $name)
+ {
+ if (!empty($edit_content[$name]))
+ {
+ $date = new egw_time($edit_content[$name]);
+ $edit_content[$name] = $date->format('ts');
+ }
+ }
+
if ($edit_content['duration'])
{
$edit_content['end'] = $edit_content['start'] + $edit_content['duration'];
diff --git a/calendar/js/app.js b/calendar/js/app.js
index be25053d13..542e76aecd 100644
--- a/calendar/js/app.js
+++ b/calendar/js/app.js
@@ -838,14 +838,8 @@ app.classes.calendar = AppJS.extend(
var sTime = this.et2.getWidgetById(selectedId+'start');
- var eTime = this.et2.getWidgetById(selectedId+'[end]');
- //Catches the start time from freetime content
- var str = sTime.get_value();
-
- var end = parseInt(str) + parseInt(content['duration']);
-
//check the parent window is still open before to try to access it
- if (window.opener)
+ if (window.opener && sTime)
{
var editWindowObj = window.opener.etemplate2.getByApplication('calendar')[0];
if (typeof editWindowObj != "undefined")
@@ -854,8 +848,9 @@ app.classes.calendar = AppJS.extend(
var endTime = editWindowObj.widgetContainer.getWidgetById('end');
if (startTime && endTime)
{
- startTime.set_value(str);
- endTime.set_value(end);
+ startTime.set_value(sTime.get_value());
+ endTime.set_value(sTime.get_value());
+ endTime.set_value('+'+content['duration']);
}
}
}
diff --git a/calendar/templates/default/app.css b/calendar/templates/default/app.css
index 308a8e44df..e3ec16fe0c 100644
--- a/calendar/templates/default/app.css
+++ b/calendar/templates/default/app.css
@@ -627,4 +627,8 @@ e.g. the div with class calendar_calTimeGrid is generated by the timeGridWidget
#calendar-list_undelete_popup, #calendar-list_delete_popup {
display: none;
-}
\ No newline at end of file
+}
+
+.calendar_freetime_header { font-size: 120%; font-weight: bold; }
+.calendar_freetime_timeframe { position: relative;}
+.calendar_freetime_dow { position: absolute; }
diff --git a/calendar/templates/default/freetimesearch.xet b/calendar/templates/default/freetimesearch.xet
index bf2d072f1a..ca10c54ffa 100644
--- a/calendar/templates/default/freetimesearch.xet
+++ b/calendar/templates/default/freetimesearch.xet
@@ -35,14 +35,13 @@
-
+
-
+
@@ -51,17 +50,17 @@
-
+
-
+
-
+
-
+
@@ -70,14 +69,13 @@
-
+
- .calendar_size120b { text-size: 120%; font-weight: bold; }
- .end_hide { visibility: hidden; }
+ body { background-color: white; }
\ No newline at end of file
diff --git a/calendar/templates/pixelegg/app.css b/calendar/templates/pixelegg/app.css
index 7ec5d7e634..09db451db8 100755
--- a/calendar/templates/pixelegg/app.css
+++ b/calendar/templates/pixelegg/app.css
@@ -11,7 +11,7 @@
* @package calendar
* @version $Id$
*/
-/* $Id: app.css 47456 2014-07-01 12:03:39Z hnategh $ */
+/* $Id: app.css 48162 2014-08-21 12:20:44Z hnategh $ */
/* Header classes */
tr.dialogHeader td,
tr.dialogHeader2 td,
@@ -631,6 +631,16 @@ e.g. the div with class calendar_calTimeGrid is generated by the timeGridWidget
#calendar-list_delete_popup {
display: none;
}
+.calendar_freetime_header {
+ font-size: 120%;
+ font-weight: bold;
+}
+.calendar_freetime_timeframe {
+ position: relative;
+}
+.calendar_freetime_dow {
+ position: absolute;
+}
/*generell*/
.egw_fw_content_browser_iframe img[src$="svg"] {
background-color: #828282 !important;
diff --git a/etemplate/js/et2_widget_date.js b/etemplate/js/et2_widget_date.js
index 9bc490eee2..e0bacfe796 100644
--- a/etemplate/js/et2_widget_date.js
+++ b/etemplate/js/et2_widget_date.js
@@ -106,6 +106,15 @@ var et2_date = et2_inputWidget.extend(
}
},
+ /**
+ * Setting date
+ *
+ * @param {string|number|Date} _value supported are the following formats:
+ * - Date object with usertime as UTC value
+ * - string like Date.toJSON()
+ * - string or number with timestamp in usertime like server-side uses it
+ * - string starting with + or - to add/substract given number of seconds from current value, "+600" to add 10 minutes
+ */
set_value: function(_value) {
var old_value = this._oldValue;
if(_value === null || _value === "" || _value === undefined ||
@@ -211,9 +220,17 @@ var et2_date = et2_inputWidget.extend(
} else if (typeof _value == 'object' && _value.valueOf) {
this.date = _value;
} else if (typeof _value == 'number' || !isNaN(_value)) {
- // Timestamp
- // JS dates use milliseconds
- this.date.setTime(parseInt(_value)*1000);
+ // string starting with + or - --> add/substract number of seconds from current value
+ if (typeof _value == 'string' && (_value[0] == '+' || _value[0] == '-'))
+ {
+ this.date.setTime(this.date.getTime()+1000*parseInt(_value));
+ }
+ else
+ {
+ // Timestamp in usertime need to be corrected with timezoneoffset as we internally use UTC for egw usertime
+ // JS dates use milliseconds
+ this.date.setTime(1000*(parseInt(_value)-60*this.date.getTimezoneOffset()));
+ }
}
// Update input - popups do, but framework doesn't