I have found the sample code to open calendar from my app, but i can't open at a specific date.
NSString* launchUrl = @"calshow://";
[[UIApplication sharedApplication] openURL:[NSURL URLWithString: launchUrl]];
Is there a way to add specific date at the end of the "lunchUrl" string so when the user opens the calendar it displays the given date.
I have already tried the following formats: @"calshow://?=2013 12 19", @"calshow://?=2013-12-19", @"calshow://?=2013+12+19". None of these seem to work for me... any ideas what am i'm doing wrong?
Swift 3
Comments on whether Apple allows to use this would be appreciated!
I played with this url scheme a little and found the way to do it. The main two points are:
calshow:
Here is the code:
And this is how I call it:
Perhaps you should take into account that
calshow:
is not a public url scheme, so maybe Apple would frown upon using it in this way. Or maybe they wouldn't (I haven't researched that).This works on ios 8 - just add seconds since 00:00 1 Jan 2001, so to open cal on 2 Jan 2001
I'm using RubyMotion, so my code looks something like this:
For react native with momentjs:
https://medium.com/@duhseekoh/need-to-open-the-os-calendar-at-a-specific-date-in-react-native-55f3a085cf8e