calendar

Google calendar watch for updates on events

限于喜欢 提交于 2021-02-05 06:58:26
问题 I want to listen programmatically when an event I created on the Google calendar is updated (like when someone accept/reject an invite) and I want to receive the relevant info regarding the event (type, confirmed/declined attendees, etc). I've tried using zapier and so far it does the job. Is there a native way to do that using Google API? I've also tried using Google calendar push notifications but the data I've received from the webhook isn't sufficient for my use case. Thanks! 回答1: You

Date Time Conversion based on the TimeZone Java/Groovy

吃可爱长大的小学妹 提交于 2021-02-05 06:40:27
问题 I am in MST and I want my Date in PST. I set the timeZone that I want. Now if i do c.getTime() I always get my server time. Instead I want Pacific Date time. Please help How to get the date time Object in the specified timezone. Calendar c= Calendar.getInstance(); TimeZone timezone= TimeZone.getTimeZone("PST"); c.setTimeZone(timezone) 回答1: Or, use JodaTime @Grab( 'joda-time:joda-time:2.3' ) import org.joda.time.* def now = new DateTime() println now.withZone( DateTimeZone.forTimeZone(

Convert java.util.Calendar ISO 8601 format to java.sql.Timestamp

扶醉桌前 提交于 2021-02-04 23:56:30
问题 I have a date in ISO 8601 date format 2015-09-08T01:55:28Z . I used this code to convert the ISO 8601 fate to a Calendar object: Calendar cal = javax.xml.bind.DatatypeConverter.parseDateTime("2015-09-08T01:55:28Z"); and now I need to use the cal.getTime() to get my time, but I need to convert it to a java.sql.Timestamp . I tried to do this: final Timestamp finalDate = (Timestamp) cal.getTime(); but I got this error: java.lang.ClassCastException: java.util.Date cannot be cast to java.sql

Creating a date with DateComponents

本秂侑毒 提交于 2021-02-04 21:49:18
问题 I want to get the first day and the last day of the week. But my results do not match the documentation from apple: https://developer.apple.com/documentation/foundation/nsdatecomponents/1410442-weekday This is my function: func startAndEndDateOfWeek(weekOfYearWithYear: (week: Int,year: Int)) -> (start: Date, end: Date) { var output = (start: Date.init(), end: Date.init()) let calendar = Calendar(identifier: .gregorian) var firstDayComponents = DateComponents() firstDayComponents.weekOfYear =

Google calendar api “Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.”

安稳与你 提交于 2021-01-29 18:49:16
问题 I am creating a booking system with server to server auth with google calendar API. Sometimes when I create events with the API I get this : { error: { errors: [ { domain: "usageLimits", reason: "dailyLimitExceededUnreg", message: "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup.", extendedHelp: "https://code.google.com/apis/console" } ], code: 403, message: "Daily Limit for Unauthenticated Use Exceeded. Continued use requires signup." } } But otherwise the API

Google Calendar with G Suite account insert get 403

别等时光非礼了梦想. 提交于 2021-01-29 13:01:08
问题 I need to use G Suite account to insert a calendar include a hangout meet but I can't even insert the event, I always get the 403 response 403 Forbidden { "code" : 403, "errors" : [ { "domain" : "calendar", "message" : "Service accounts cannot invite attendees without Domain-Wide Delegation of Authority.", "reason" : "forbiddenForServiceAccounts" } ], "message" : "Service accounts cannot invite attendees without Domain-Wide Delegation of Authority." } I use the GCP p12 file and the service

Calendar class confusion

耗尽温柔 提交于 2021-01-29 02:27:24
问题 I was playing with the Calendar class and got some confusing results: Calendar thisCal = Calendar.getInstance(); thisCal.clear(); thisCal.set(2012,12,8); System.out.println("Year is: " + thisCal.get(Calendar.YEAR)); System.out.println("Month is: " + thisCal.get(Calendar.MONTH)); System.out.println("Day of Month is: " + thisCal.get(Calendar.DAY_OF_MONTH)); The output: Year is: 2013 Month is: 0 Day of Month is: 8 Confused I am! 回答1: The MONTH field is zero based (inherited from some POSIX API,

Store data in Custom Fields or attachment in ics iCal file

前提是你 提交于 2021-01-28 11:49:27
问题 I need to give my manually built iCal file (.ics) some additional infos which I actually don't want to be visible for Calendar app users. Thus I need to be able to set them manually when creating an Event in an iOS application and (later) reading them from the Calendar events. I was wondering whether it is possible to add custom fields / attributes to a iCal / .ics file itself (not by using a calendar application!). They shall not be displayed in a Calendar application but accessible for me

Android CalendarContract.Instances table returns old values

↘锁芯ラ 提交于 2021-01-28 11:47:59
问题 I am querying the CalendarContract.Instances table to read all calendar event instances within a time interval (curr_time, next_time), as shown in the code below. This code works when the calendar entries have been around for a while. However, if I add a new entry, change an existing entry, or delete it, I get some old/stale entries (e.g., a new entry is not returned when it should be, or the unmodified/deleted entry is still returned), and this happens consistently. This problem occurs on my

Android CalendarContract.Instances table returns old values

断了今生、忘了曾经 提交于 2021-01-28 11:37:30
问题 I am querying the CalendarContract.Instances table to read all calendar event instances within a time interval (curr_time, next_time), as shown in the code below. This code works when the calendar entries have been around for a while. However, if I add a new entry, change an existing entry, or delete it, I get some old/stale entries (e.g., a new entry is not returned when it should be, or the unmodified/deleted entry is still returned), and this happens consistently. This problem occurs on my