Example usage for com.liferay.portal.kernel.util StringPool UTC

List of usage examples for com.liferay.portal.kernel.util StringPool UTC

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.util StringPool UTC.

Prototype

String UTC

To view the source code for com.liferay.portal.kernel.util StringPool UTC.

Click Source Link

Usage

From source file:com.zenixia.plugins.util.RoomUtil.java

License:Open Source License

public static TimeZone getRoomBookingDisplayTimeZone(RoomBooking roomBooking, TimeZone defaultTimeZone) {

    if ((roomBooking != null) && roomBooking.isAllDay()) {
        return TimeZone.getTimeZone(StringPool.UTC);
    }//from   www.j a  v  a2 s .  c o m

    return defaultTimeZone;
}

From source file:com.zenixia.plugins.util.RoomUtil.java

License:Open Source License

public static JSONObject toRoomBookingJSONObject(ThemeDisplay themeDisplay, RoomBooking roomBooking,
        TimeZone timeZone) throws SystemException {

    JSONObject jsonObject = JSONFactoryUtil.createJSONObject();

    jsonObject.put("allDay", roomBooking.isAllDay());
    jsonObject.put("roomBookingId", roomBooking.getRoomBookingId());
    jsonObject.put("roomId", roomBooking.getRoomId());
    jsonObject.put("description", roomBooking.getDescription(themeDisplay.getLocale()));

    if (roomBooking.isAllDay()) {
        timeZone = TimeZone.getTimeZone(StringPool.UTC);
    }// w w w . ja v  a  2s.com

    java.util.Calendar endTimeJCalendar = JCalendarUtil.getJCalendar(roomBooking.getEndTime(), timeZone);

    _addTimeProperties(jsonObject, "endTime", endTimeJCalendar);

    jsonObject.put("firstReminder", roomBooking.getFirstReminder());
    jsonObject.put("firstReminderType", roomBooking.getFirstReminderType());

    //      jsonObject.put("instanceIndex", roomBooking.getInstanceIndex());
    //      jsonObject.put("location", roomBooking.getLocation());
    //      jsonObject.put(
    //         "parentRoomBookingId",
    //         roomBooking.getParentRoomBookingId());
    jsonObject.put("recurrence", roomBooking.getRecurrence());
    jsonObject.put("secondReminder", roomBooking.getSecondReminder());
    jsonObject.put("secondReminderType", roomBooking.getSecondReminder());

    java.util.Calendar startTimeJCalendar = JCalendarUtil.getJCalendar(roomBooking.getStartTime(), timeZone);

    _addTimeProperties(jsonObject, "startTime", startTimeJCalendar);

    jsonObject.put("status", roomBooking.getStatus());
    jsonObject.put("title", roomBooking.getTitle(themeDisplay.getLocale()));

    return jsonObject;
}