QR Code calendar event with relative dates - qr-code

I am looking for a QR code that could add a Vcal event with:
Start date and time: as of the date and time the code is scanned
End date and time: exactly xx weeks after the start date (say 2 weeks)

In iCalendar, you can specify a duration inside a VEVENT with the DURATION property. (See section 4.3.6 of RFC 2445.) You can use this instead of DTEND. The syntax is a little hard to explain; you can see it in the RFC. DURATION:PT1H30M means 1 hour, 30 minutes. DURATION:P2W means two weeks.
So, you can just add this to the VEVENT you were already going to encode in a QR code.
Of course, whether a reader reads it correctly is another story. I can tell you that zxing does not read DURATION. Because I wrote it and I have just learned that DURATION exists. I will add it as a to-do to parse correctly.

Related

Changing a time

I have a scheduling system on which several people schedule activities, by adding to a Google Sheet event_id, start_date, finish_date and start_time (HH:mm). This goes through various validity checks, including matching start_time to a list of valid start times on another sheet.
This works. But some of these activities are between midnight and 6am, and are therefore scheduled as belonging to the day before and sorted to the end of the daily list, not the beginning.
I do this by, for example, entering 01:30 as 25:30, which then displays as 01:30 and stores as Sunday Dec 31 1899 01:30:00, and all works as it should.
But when other people enter start times, they will often forget the instructions and enter the start time as 01:30, which does not match the validation and further processing. What I am trying to achieve is an automatic change to such entries, such that one day is added and the system stores Sunday Dec 31 1899 01:30:00, which matches the validation.
But it doesn't. Entering 25:30 by hand works perfectly, but entering 01:30 and then passing it to:
if (stime.getDay() == 6 && shr < daystart){
stime.setDate(31);
osheet.getRange(activerow,7).setValue(stime);
appears to work, but then does not match the validation grid.
I have tried numerous ways to add the 24 hours, such as
stime.setDate(stime.getDate()+1);
but all with the same outcome. A manual input of 25:30 checked for equality against the appropriate cell in the validation grid returns TRUE; any computational method returns FALSE on the same test.
I am clearly doing something stupid, but what?
Thank you for reading this.
It's always the way. Give up, ask for help, and then the answer occurs to you. There is a calculation error somewhere; the calculated value differs from the manual input from the 11th decimal place onwards. So, surrounding both parameters in the validation check with a =ROUND(stime,8) etc, will fix it. Sorry to have wasted your time. But I'll leave this here in case anybody else has a similar problem.

User Deletion API: userDeletionRequests:upsert :: deletionRequestTime field

Can someone give little clarification how to interpret following parameter:
deletionRequestTime: datetime`:
This marks the point in time up to which all user data for the specified end user and Google Analytics property or Firebase project should be deleted.`
If I set it to 1st Jan2018 (GTM), does it delete all user data:
from that date till today (which is how I interpret).. meaning all 2018 data will be gone?
or, (from epoch time) till that date ... meaning all 2016/2017 etc. data is gone and all that remains is 2018 data?
When trying the API > refreshed User Explorer report in GA interface > I notice all-time data seems is gone (giving me impression that this filed is not respected?). But let me wait 72hrs since API request to draw any conclusion..
Thanks for any clarification.
Cheers!
First off i dont think your miss-interperting it I dont think the documentation is clear.
The following is from userDeletionRequest
deletionRequestTime datetime
This marks the point in time up to which all user data for the specified end user and Google Analytics property or Firebase project should be deleted.
Now to me that means that its a point in time that the data should be deleted. as in one day? one minute a time stamp? would this then mean you will need to loop though every hour minute in a day to delete everything.
My current answer is this is confusing. I am going to contact the team for clarification they are in West coast USA we wont get an answer back for several hours. I will updated this when i know more.
Clarification from Google
As per documentation, deletionRequestTime represents a timestamp up to
which all use data will be deleted. In other words, all data from the
beginning of time until the point returned in deletionRequestTime will
be deleted.
I don't believe you can set the deletionRequestTime field. It is set to the time you make the call.
I believe that is why you are seeing this behavior.

Use measurement protocol to create transaction/item for a specific date

I am using the following URL to generate an item for the transaction.
http://www.google-analytics.com/collect?v=1&tid=someID&cid=someID&ti=126540&ta=Another%20type&tr=400.00&tt=0&ea=Purchase&pa=purchase&ec=Enhanced%20Ecommerce&ts=0&cu=UAH&t=event&pr1id=cha803478-WTC%2FNBK&pr1nm=foo%202PP%20crew%20socks&pr1ca=foo&pr1pr=199.00&pr1br=foo&pr1qt=1
After a few days I will need to change it, because any data in it will be not correct. Is there a way to specify date on this URL so that the modification of the transaction was the day it was created?
No. While there is the queue time parameter that allows for a few hours offset there is not way to specify a date in a hit (that would force Google to reprocess a lot of data to integrate hits for previous dates in the reports).

IFTTT - record timestamp (rather than time range) in Google Calendar

I created an IFTTT recipe that logs the time I arrive and leave work every day, but it always records it in 1hr blocks.
I'm using iPhone's location to track when I arrive and leave. Everything seems to be working, but calendar events are showing as 1hr blocks rather than just a timestamp.
For example, if I arrive at 8:05am it will show as a block on my calendar from 8:05 to 9:05 rather than just showing for one minute. I'd rather it just say "I arrived at work at 8:05". Thanks in advance!
Am I right in assuming you used the default "Track your work hours in Google Calendar" applet made by Google ?
It uses the Quick add event action to add this event to your calendar. Instead, create your own version of the applet that uses the Create a detailed event action. This allows you to set the following parameters (specifically, it includes Start time and End time):
You can set the start time and end time to the same value, but it will, of course, still read as an event that runs from e.g. 9:05 to 9:05.
If you want to record just a single timestamp, you will need to use a different service to store your data. Perhaps record the data in a Google spreadsheet ?
Any queries, post a comment and I'll get back to you.

How to reliably determine time zone for a user from the Twitter API?

When getting information from Twitter's API for a user, they provide two fields related to the user's time zone:
utc_offset: -14400,
time_zone: "Indiana (East)"
Unfortunately, this doesn't tell the full story because I don't know if that UTC offset was calculated during standard time or daylight savings time. After dividing by 3600 seconds, I get -4 hours, which is valid during the summer months, but in the winter the correct value would be -5 hours.
If the value was ALWAYS determined by the daylight savings time value then I could write an algorithm for that, however after some searching on the subject I've seen several pasted outputs that contradict that assumption. (as a quick example, this question shows his/her offset as -21600 and then he/she says he/she is on central time, which if calculated during daylight savings time would be -18000).
It would make sense to me that the value would be calculated as of Jan 1 and the several pasted outputs I've found online fall into that category, but my own Twitter account shows the values listed above for which this assumption is invalid. My next thought was maybe it was calculated at the time I created my account, but then that seems erroneous as well because I can change my time zone at any later point (and even so, I created my account in November when I would have been on standard and not daylight time!).
My last thought was that maybe the value is being calculated by the date of the API request. This makes a lot of sense and the Twitter accounts I own all seem to validate this. BUT, the SA question I linked to earlier shows that the person answered the question on June 2nd, which is daylight savings time and his/her value of -21600 reflects a standard time for the Central time zone.
Anyone out there solve this problem? Thanks so much!
Twitter's front end uses Ruby on Rails. If you go to your own twitter account settings and look at the possible options for time zones (view source on the dropdown list), you will find that they match up with those provided by ActiveSupport::TimeZone, shown in this documentation. Although there appears to be some zones understood by Rails that Twitter has omitted, all of the Twitter zone key names are in that list.
I have asked Twitter to use standard time zone names in the future, in this developer request.
Why does Rails limit this list and use their own key values? Who knows. I have asked before, and gotten very little response. Read here.
But you can certainly use their mapping dictionary to turn the time_zone value into a standard IANA time zone identifier. For example:
"Indiana (East)" => "America/Indiana/Indianapolis"
"Central Time (US & Canada)" => "America/Chicago"
This can be found in the Rails documentation, and in the source code. (Scroll down to MAPPING.)
Then you can use any standard IANA/Olson/TZDB implementation you wish. They exist for just about every language and platform. For further details, see the timezone tag wiki. If you need help with a specific implementation, you'll need to expand your question to tell us what language you are using and what you have tried so far. (Or consider asking a new question about just that part of it.)
In regards to the utc_offset field, twitter does not make it clear what basis they use to calculate it. My guess is that it is the user's current offset, based on the time that you call the API.
Update 1
I have added support for converting Rails time zone names to both IANA and Windows standard time zone identifiers in my TimeZoneConverter library for .NET. If you are using .NET, you can use this library to simplify your conversions and stay on top of updates more easily.
Update 2
Twitter's API now returns the time zone in this format:
"time_zone": {
"name": "Pacific Time (US & Canada)",
"tzinfo_name": "America/Los_Angeles",
"utc_offset": -28800
},
Use the tzinfo_name field. Done. :)

Resources