META-INF.resources.commerce_order.requested_delivery_date.jsp Maven / Gradle / Ivy
<%--
/**
* SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
* SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
*/
--%>
<%@ include file="/init.jsp" %>
<%
CommerceOrderEditDisplayContext commerceOrderEditDisplayContext = (CommerceOrderEditDisplayContext)request.getAttribute(WebKeys.PORTLET_DISPLAY_CONTEXT);
CommerceOrder commerceOrder = commerceOrderEditDisplayContext.getCommerceOrder();
Date requestedDeliveryDate = commerceOrder.getRequestedDeliveryDate();
%>
<%
int requestedDeliveryDay = 0;
int requestedDeliveryMonth = -1;
int requestedDeliveryYear = 0;
if (requestedDeliveryDate != null) {
Calendar calendar = CalendarFactoryUtil.getCalendar(requestedDeliveryDate.getTime());
requestedDeliveryDay = calendar.get(Calendar.DAY_OF_MONTH);
requestedDeliveryMonth = calendar.get(Calendar.MONTH);
requestedDeliveryYear = calendar.get(Calendar.YEAR);
}
%>