This is an automated email from the ASF dual-hosted git repository.

solomax pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/openmeetings.git


The following commit(s) were added to refs/heads/master by this push:
     new 6b10fb7  [OPENMEETINGS-2547] zoned LocalDateTime is used for invitation
6b10fb7 is described below

commit 6b10fb76f2dba7f77c728488877fc0c3b8f4df8e
Author: Maxim Solodovnik <solomax...@gmail.com>
AuthorDate: Thu Jan 7 11:59:14 2021 +0700

    [OPENMEETINGS-2547] zoned LocalDateTime is used for invitation
---
 .../java/org/apache/openmeetings/web/common/InvitationForm.java    | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/InvitationForm.java
 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/InvitationForm.java
index 237c5f0..fd8bd00 100644
--- 
a/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/InvitationForm.java
+++ 
b/openmeetings-web/src/main/java/org/apache/openmeetings/web/common/InvitationForm.java
@@ -23,8 +23,10 @@ import static 
org.apache.openmeetings.util.CalendarHelper.getDate;
 import static org.apache.openmeetings.web.app.Application.getInvitationLink;
 import static org.apache.openmeetings.web.app.WebSession.AVAILABLE_TIMEZONES;
 import static org.apache.openmeetings.web.app.WebSession.getUserId;
+import static org.apache.openmeetings.web.util.CalendarWebHelper.getZoneId;
 
 import java.time.LocalDateTime;
+import java.time.ZonedDateTime;
 import java.util.ArrayList;
 import java.util.Collection;
 
@@ -195,8 +197,9 @@ public abstract class InvitationForm extends 
Form<Invitation> {
                User u = userDao.get(getUserId());
                i.setInvitedBy(u);
                i.setRoom(null);
-               from.setModelObject(LocalDateTime.now());
-               to.setModelObject(LocalDateTime.now().plusDays(1));
+               LocalDateTime now = 
ZonedDateTime.now(getZoneId()).toLocalDateTime();
+               from.setModelObject(now);
+               to.setModelObject(now.plusDays(1));
                i.setPassword(null);
                i.setHash(null);
                subject.setModelObject(null);

Reply via email to