QR Code for event that DTSTART is relative to today - qr-code

Is it possible to create a QR Code that sets up an event in the calendar with a date that is relative to the date the code is scanned?
Example: Scan code and 2 months from today, my phone shows an event or provides me with a reminder alert.

You can create a QR Code that's pointing an url where is located an .ics file. One time that the file is downloaded a pop-up appears on the device, setting up the event.
You can create custom .ics file, for example, here: http://www.pratie.com/lab/icalendar/
EDIT:
you can compile dynamically the DSTART variable in your code programming:
BEGIN:VCALENDAR
VERSION:1.0
BEGIN:VEVENT
DTSTART:20121121T090000
DTEND:20121121T100000
SUMMARY:fdsf
LOCATION:
DESCRIPTION:
PRIORITY:3
END:VEVENT
END:VCALENDAR
The format of variable DSTART is the following:
DSTART: <year><month><day>T<hour><minutes><seconds>
To use a relative "now" time you can use the multiple options that programming gives. (Time.now, timestamp), and then convert it to correct .ics output.

Icalendar spec (RFC5545) does not allow the DTSTART to be relative:
3.8.2.4. Date-Time Start [...] The time value MUST be one of the forms defined for the DATE-TIME value type. The value type can be set to a DATE value type.
3.3.4. Date [...] The textual format specifies a four-digit year, two-digit month, and two-digit day of the month.
3.3.5. Date-Time [...] The "DATE-TIME" value type is used to identify values that contain
a precise calendar date and time of day.
However the QRCODE could be a link to a url which would then dynamically generate a ical file with a DTSART which would be set to the date 2months in the future.

Related

How to add time to schema event type

My startDate looks like this 03-03-2020 but I need to add time as well. I have checked some example schema from other sources and have come across something similar:
2020-03-03T12:45:00+01:00
I have two concerns:
Does the time format matter? My format is dd-mm-YYYY. The second example format is different. Is there any problem having it either way?
How do you properly add the time time to the startDate property. Is the last extension the TimeZone e.g +03:00 or should you use the Universal Time zone then include your Timezone (Time offset).
Please help clarify.
I have two concerns: Does the time format matter? My format is
dd-mm-YYYY. The second example format is different. Is there any
problem having it either way?
If you check the description of the startDate property then there you will see the following information:
The start date and time of the item (in ISO 8601 date
format).
If you follow the specified link, then in the Wikipedia article (in the right panel) you can see the following time format:
Date 2020-03-04
In order to establish a machine-readable format, you can use an HTML element such as time with datetime.
======================================
How do you properly add the time time to the startDate property. Is
the last extension the TimeZone e.g +03:00 or should you use the
Universal Time zone then include your Timezone (Time offset).
Indicate time in ISO format with a time offset, e.g., if you are located in the Canadian province of Yukon then you can use a time zone indication such as 2020-03-04T05:16:15-08:00.
In Sweden, I have Central European Time with a time offset of +1 hour and summertime +2 hours. So at the moment in Sweden, I can use a time format such as 2020-03-04T05:22:16+01:00. However, the Sweden summertime will be in a format such as 2020-07-04T05:22:16+02:00

Google Docs Forms - need Pre-fill Date & Time Entry with current date and current time

Google Forms I need Pre-filled current Date & current Time Entry in date and time fields of my google form. How to do it
My solution is to make the Date field optional. The default is to assume the todays date which is what you get from the timestamp field. In case it needs to be anything else you can enter it manually.
A simple code-free solution is to make separate sections in your form and use the feature that routes users to different sections based on responses. The first section asks whether the form is for the current date/time. If yes, you use the timestamp as the date and time and route the user to the main section with your questions. If not, route them to a section to set the date and time, and then after that route them to the main section.
2023 Solution
-Google Forms has updated how dates are passed through URL parameters.
Instead of passing each component of a date as a separate param, you now pass them using the same syntax as all other fields using the YYYY-MM-DD format for your date value.
Here is an example URL:
`https://docs.google.com/forms/d/e/${formId}/viewform?usp=pp_url&entry.${dateEntryFieldID}=${YEAR}-${MONTH}-${DAY}`

How to set a date for WKInterfaceDate

Can WKInterfaceDate show a date & time different from the current values?
If yes, how can I set a different date?
apple documentation says:
A WKInterfaceDate object is a custom label that displays the current
date or time. Use this object when you want to display date or time
information without further interaction from your WatchKit extension.
At runtime, use the date object to configure the appearance of the
date and time information being displayed.
For different date you can simply create label and set it's text to a String that you create with NSDateFormatter out of some NSDate.

AppInventor: how to insert DateTime into Google Spreadsheet and show only recent DateTime

I am new to this forum so I hope I asking my question in the right place.
I have a problem inserting a datetime into a Google Spreadsheet from a form created in Appinventor2;
In app inventor2 I created a form that fills in a google spreadsheet. Basically I merged the Pizza Party example (http://appinventor.mit.edu/explore/ai2/pizzaparty.html) with this example http://puravidaapps.com/spreadsheet.php to use google spreadsheet instead of fusion table.
the user selects in how many minutes he wants his order and then sees all the orders in a table sorted by delivery time.
Problem A)
Firstly, i want to save the current datetime + the desired delay into the google spreadsheet and sort the table by this new datetime.
1) when i use the block "call clock format time" + "call clock addminutes" the spreadsheet is populated with a text, but then i can't sort the table by delivery datetime. in fact i believe the sorting is done on the number regardless of the am/pm or day of the month. so for example instead of having 4am, 6am, 2pm, 3pm i get : 2pm, 3pm, 4am, 6am.
2) I then tried to remove the block "call clock format time" and in the google form i kept the field format = text
but the google spreadsheet is populated with the following:
java.util.GregorianCalendar[time=1395531335908,areFieldsSet=true,lenient=true,zone=Europe/Dublin,firstDayOfWeek=2,minimalDaysInFirstWeek=4,ERA=1,YEAR=2014,MONTH=2,WEEK_OF_YEAR=12,WEEK_OF_MONTH=4,DAY_OF_MONTH=22,DAY_OF_YEAR=81,DAY_OF_WEEK=7,DAY_OF_WEEK_IN_MONTH=4,AM_PM=1,HOUR=11,HOUR_OF_DAY=23,MINUTE=35,SECOND=35,MILLISECOND=908,ZONE_OFFSET=0,DST_OFFSET=0]
3) I then tried to remove the block "call clock format time" and in the google form I changed the field format = time
but then the google spreadsheet isn't populated with anything.
4)I tried using the segment block, but after a while I realised the block "format time" actually returns this format: "hh:mm:ss AM/PM"
so selecting the 5 characters is not good enough because it does not take into account of the am/pm element as well as the day of the month.
5) I found a temp solution by defining the desired delivery time as a new global variable, and extracting a string in the format hh:mm by joining the blocks ".hour instant" and ".minute instant".
However this is not a final solution because what i extracted is of course a string of text and when sorting, 01:10 will be always considered smaller than 23:50 for example, regardless of the date.
So is there a way of actually saving in the google spreadsheet not a string of text, but actually the date and time?
Problem B)
Secondly, I would like to filter/show only the rows of the google spreadsheet have a delivery time expired by no more than 1 hour (as well as orders with delivery time in the future e.g. in 2 hours from now()).
I tried using some Google Visualization API Query Language commands, altering the url of the google spreadsheet (like WHERE "now() - Delivery Time < 60 mins)" (cannot remember the exact code I wrote) but unsucessfully.
Would anyone know how to filter my results?
thanks in advance
alterettore
So there's a few things to note.
If you're using Taifun's example as you mention, you'll notice that when you submit data to Google Spreadsheets using a form, the first column is always a timestamp, even if you're not submitting a date or time. Trying to send the current date/time is redundant - go ahead and make use of what Google provided.
Google Spreadsheets (and Excel) store Date/Time as a number. If you want to store a date in GS, the best way to do so is not formatted text, but by sending a number. Use AppInventor to calculate the number you need. For example, today (April 27) in GS is 41756. Noon today would be 41756.5
To generate this number, start with AI's Millisecond function. NOTE: Both GS and AI use milliseconds, but they have different 0 points, so you have to manipulate the result a bit. The formula I've used in AI in the past is this:
GS Date/Time = (Clock1.GetMillis(Clock1.Now) / 86400000) + 25569
Hope this helps!

How to trim datetime string to its minute in GridView?

I have bound fields in GridView to some dateTime property of data objects. The fields are displayed to the seconds level. It looks like 2009-2-3 18:00:00 PM.
I just want it displayed to the minutes, e.g 2009-2-3 18:00.
What is the best way to do this?
Edit:
I find use DataFormatString="{0:g}" is fine for me.
The format is 2009-2-3 6:00 PM.
Although you have found a solution, here's some additional information:
You can find a list of all standard date and time format strings (such as "g") on this page in MSDN: Standard DateTime Format Strings.
And if do not want to use one of the predefined formats, there is also a page about Custom Date and Time Format Strings. For example, to get a date exactly in the format you used in your question ("2009-2-3 18:00") you could use the format string "yyyy-M-d HH:mm".
Before using a custom format string, remember that using the standard (predefined) format strings has the advantage that it automatically takes into account the current culture (regional settings). So if you want to display the date to users, probably a predefined format will be the better choice.

Resources