Event download as ICS file - aem

I've created a event using foundation event component (/libs/collab/calendar/components/event) and set the required values. But if I try to download the event ICS file then it's throwing following exception:
com.day.cq.wcm.core.impl.WCMDebugFilter Exception: null java.lang.NullPointerException
at edu.emory.mathcs.backport.java.util.concurrent.ConcurrentHashMap.get(ConcurrentHashMap.java:769)
at net.fortuna.ical4j.model.TimeZoneRegistryImpl.getTimeZone(TimeZoneRegistryImpl.java:136)
at com.adobe.cq.social.calendar.impl.JcrTimeZoneRegistry.getTimeZone(JcrTimeZoneRegistry.java:101)
at com.adobe.cq.social.calendar.servlets.ICalExportServlet.doGet(ICalExportServlet.java:129)
at org.apache.sling.api.servlets.SlingSafeMethodsServlet.mayService(SlingSafeMethodsServlet.java:268)
at org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:344)
at org.apache.sling.api.servlets.SlingSafeMethodsServlet.service(SlingSafeMethodsServlet.java:375)
at org.apache.sling.engine.impl.request.RequestData.service(RequestData.java:508)
at org.apache.sling.engine.impl.filter.SlingComponentFilterChain.render(SlingComponentFilterChain.java:45)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:64)
at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilterWithErrorHandling(WCMDebugFilter.java:182)
at com.day.cq.wcm.core.impl.WCMDebugFilter.doFilter(WCMDebugFilter.java:149)
at org.apache.sling.engine.impl.filter.AbstractSlingFilterChain.doFilter(AbstractSlingFilterChain.java:60)
at com.day.cq.wcm.core.impl.WCMComponentFilter.doFilter(WCMComponentFilter.java:144)
It appears from the stacktrace that event timezone is set to null. I don't see how to set it or am missing anything else.
Thanks

This is actually a bug on CQ side, following is the response that I got on Adobe forum:
Issue has been filled (CQ5-34388) internally. As a workaround manually set the timezone. Ex:- for geometrixx "/content/geometrixx/en/events/shapecon/jcr:content/par/event/event" path create a property called "timeZone" of type "String" and assign value as "Asia/India" which is IST time zone.
So, the issue is because of "timeZone" not getting set with event. One of the thing that I noticed is, 'timeZone' does get set if you set time with date, say 11:00 AM to 1:00 PM on 12 Dec 2013. The issue is only if time is not set i.e. event is marked as full day event.

Related

Rundeck time format

In the "Activity for jobs' page in Rundeck the execution time has a relative time field (example: "Today at 10:15 AM" or "Last Sunday at 4:51 AM") after the timestamp.
It is easy to change the date format of the timestamp by adding jobslist...format[.ko] in the i18n/messages.properties file.
It seems impossible however to change the format of the relative time message. It seems to be hard-coded in en_US with AM/PM which doesn't look too good in in non-English-speaking countries. The format is always the same regardless of the ?lang=xx parameter or the default language in the browser. Interestingly, other objects (like hovering over the field with the mouse and the duration get translated).
Has anyone successfully changed this?
Example. See the duration field
I have been trying this with the docker images (4.8.0, 4.9.0 and SNAPSHOT)
I've looked at the source code and apparently this lies somewhere in the moment.js code.
In some parts, the date formats are hard coded as you say, please add your use case on this thread.

How can you set a timezone in an outlook.com link?

I'm trying to set correct times for an Outlook event in the UK, but Outlook seems to set the incorrect time for BST (British Summer Time).
Here is a link, which creates an event for 19th June 2017 at 1254pm to 1257pm.
In my Outlook it opens an hour ahead as 1354pm. Is there a way to explicitly set the timezone in the link?
I've tried checking my settings and using a different Outlook account so I don't think it's an issue with my mail/calendar settings.
https://bay02.calendar.live.com/calendar/calendar.aspx?rru=addevent&dtstart=20170619T125400&dtend=20170619T125700&summary=Summary+of+the+event&location=Location+of+the+event&description=example+text.&allday=false&uid=
After researching quite I've realised that Outlook always expresses time in UTC when sending a link. Therefore you need to convert the date/time from BST to UTC. You can do this with PHP like this:
$date = new DateTime('2017-06-22T12:54', new
DateTimeZone('Europe/London')); /* <-- Time zone to be converted */
echo $date->format('YmdHis') . "\n";$date->setTimezone(new
DateTimeZone('UTC'));echo $date->format('YmdHis') . "\n"; /* <-- New time zone, UTC */

Org mode icalendar export: how to avoid timestamp in description or summary

I have an agenda that I want to export as an icalendar file.
I do not use properties and org-mode export determines summary and description automatically from the headers and bodys.
The entries were like this one
* <2015-05-19 Tue 13:45-15:15> My entry
Sometimes, this worked properly. I got an entry with summary "My entry" at the time specified by the timestamp. Now, the entry is correctly put at the time, but the timestamp is included into the summary and therefore I can see it in my calendar application.
I have tried, permuting the order of timestamp and header, but the best i have got is by putting the timestamp in the body, as in the following entry
* My entry
<2015-05-19 Tue 13:45-15:15>
Now, the tismestamp is no longer in the summary, but in the description of the event.
I have tried going through the org-mode options but I have not find any possible explanation of this changing.
Can anybody help me in using timestamp to correctly put the event, but avoiding to include it into the exported event?
I'm having the same problem. I found that you can add properties to each item to specify what should be in the summary, like so:
* <2015-05-19 Tue 13:45-15:15> My entry
:PROPERTIES:
:SUMMARY: My entry
:END:
(You can also add LOCATION and DESCRIPTION properties)
But that's pretty annoying.

Robotframework: Getting date at runtime using Get Current Date, in specific format

I am using the Get Current Date keyword to return the date in the format year-month-day. I use this particular information to make sure that an account's created timestamp is correct in automated tests.
The issue is that the keyword is not recognised, my code should be correct (it should work and it should produce the date in the format I wish.
*** Keywords ***
Initialize Test Data
${DATE}= Get Current Date result_format=timestamp
${MYNUM}= faker.Random Int
Set Suite Variable ${MYNUM}
Set Suite Variable ${DATE}
Why do I get the error No keyword with name 'Get Current Date' found.?
Thanks in advance.
Does a keyword Get Current Date exist in standard RF lib? There is a builtin keyword called Get Time instead. Documentation explains how to format output. To use Get Current Date you need to import DateTime library first.
Update:
RF script sample which works for me:
*** Settings ***
Library DateTime
*** Test Cases ***
datatimetest
${d}= get time
log {d}
${d}= Get Current Date result_format=%Y-%m-%d
log {d}
${d} = Add Time To Date 2014-05-28 12:05:03.111 7 days
log {d}
Please remember that DateTime is a new library so in case you have old version of Robot Framework, you need to either install library or upgrade RF.
I'm using RF with Python and by default my IDE detects Python DateTime library.
Try to use the full path:
Library robot.libraries.DateTime
robot.libraries.DateTime.
You can also format the time as you like. See this answer. It offers format suggestions. You can use Python DateTime functions as in
${now} Evaluate '{dt.day}/{dt.month}/{dt.year}'.format(dt=datetime.datetime.now()) modules=datetime
Log ${now}
Log to Console now time 1: ${now}
${now} Evaluate '{dt:%A}, {dt:%B} {dt.day}, {dt.year}'.format(dt=datetime.datetime.now()) modules=datetime
Log ${now}
Log to Console now time 2: ${now}

Importing ICS into Google Calendar with correct timezone

I'm trying to import a simple ics file into Google calendar. However, even though I have the timezone specified, Google calendar still imports the wrong event time. (Although it does say that the wrong time is in the correct timezone.)
Here is a sample of my ics file:
BEGIN:VCALENDAR
BEGIN:VEVENT
DESCRIPTION: Test_Description
DTEND;TZID=US-Pacific:20140606T180000
DTSTART;TZID=US-Pacific:20140606T170000
LOCATION:Test_Location
SUMMARY:Test_Summary
UID:20140606T150000#NL
END:VEVENT
END:VCALENDAR
This event should show up as occurring on June 6, from 5PM-6PM Pacific Standard Time. However, on my calendar it shows up as occurring on June 6, from 10AM-11AM PST.
I think (although have not implemented) a hack to just change everything to UTC and adjust the event time accordingly might work. However, this would be a little annoying to implement and honestly Google Calendar should be able to handle this simple of an import.
Does anyone have any suggestions to deal with this, or see any bugs in my ICS file?
Thanks!
To make your ICS work with Google's "Add by URL..." specify your timestamps in UTC and add the X-WR-TIMEZONE. Timestamp must have the Z at the end to mark the timestamp as UTC:
DTSTART:20140102T110000Z
Also add the timezone specification in the VCALENDAR block like this:
X-WR-TIMEZONE:Europe/Zurich
After adding the calendar in Google Calendar, the time zone for should be set correctly in the calendar's settings.
If you are using PHP to generate the ICS, you can convert the timestamps to UTC like this:
// The timestamp in your local time and your local time zone
$timestamp = "01.01.2016 12:00";
$timezone = new DateTimeZone('Europe/Zurich');
// The UTC timezone
$utc = new DateTimeZone('UTC');
// Create a DateTime object from your timestamp using your local timezone
$datetime = DateTime::createFromFormat("d.m.Y H:i",$timestamp, $timezone);
// Set the timezone on the object to UTC.
$datetime->setTimezone($utc);
// Print the time in UTC and use the correct format for ICS
echo $datetime->format('Ymd\THis\Z');
This also works on Apple's iPhones.
Normally it is required to include VTIMEZONE objects. Many people are starting to omit that, but if you do, at least use an olson-identifier. This should be enough for google calendar to pick up the correct timezone.
An example of an olson identifier is Europe/Amsterdam. Look up the identifier the most appropriate for you. Presumably this is something like America/Los_Angeles.