简体   繁体   中英

Can an HTML link be made to open a datetime in a calendar?

I am making myself a little table of deadlines in HTML and I've come across a question I've never thought about before.

I know that HTML links can reference more than just HTTP(S) webpages. They can open several types of addresses and external applications, particularly on mobile devices. For example, if I wanted to connect users to Lou Malnati's Pizza in Lake Forest, IL there are lots of ways I could do that using only <a> tags.

I can open a phone number in the default phone app

<a href="tel:+18477351515">Call Us</a>

I can start an email draft in the default webmail browser

<a href="mailto:webmaster@loumalnatis.com">Email</a>

I can go to a specific location in the default maps application

<a href="geo:42.224948,-87.874244">Directions</a>

In iOS I can even open a restaurant's page in the Yelp app

<a href="yelp:///biz/lou-malnatis-pizzeria-lake-forest">Yelp</a>

There are even more that I'm not mentioning, especially in Darwin systems (including OS X). I was thinking about this as I was writing my table of deadlines, and I started to wonder if I could do the same thing with a datetime. This leads me to my real question.

Is there any URL scheme in Darwin that will open Calendar to specific datetime?

Comme ça (using Darwin's usual ISO 8601 )

<a href="date:1918-11-11T11:00:00+02:00">The Guns Fell Silent</a>

I know that OS X uses the same system of URL based inter-app communication that iOS does, so I figure there's got to be a way. Like I said, this table is really just for me so if it works on my OS X laptop that's good enough for me.

I guarantee an up-vote to anyone who gives an answer that is at all useful. Thanks so much to anyone who can help.

PS To be clear, the HTML5 <time> tag is not a solution.

While I was researching this question on my own I found a W3Schools article about the new HTML5 <time> tag . This would be exactly what I'm looking for, except that it does nothing. The <time> tag is theoretically implemented in all HTML5 compliant browsers, including Chrome, Safari, Firefox, Edge, and Opera. But they only implement it in the sense that they are prepared to ignore it (as opposed to viewing it as a syntax error).

Adding a <time> tag changes literally nothing about the UX of an HTML page. It's useful only for deep internals of the browser or search engine presenting it. In the W3Schools article they say...

Note: The time element does not render as anything special in any of the major browsers.

This element can be used to encode dates and times in a machine-readable way so that user agents can offer to add birthday reminders or scheduled events to the user's calendar, and search engines can produce smarter search results.

So I say again, I'm looking for something better than <time> elements.

I can't find anything related to time in the IANA Uniform Resource Identifier (URI) Schemes so I don't think this available out of the box. Only option would be to add a custom protocol to the client's computer if that's possible.

Edit: Calender access protocol might be useful for you but I don't think this is the behaviour you are describing.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM