Pickin’ dates on iOS

This is a little follow-up to my post about web components for date inputs.

If you try the demo on iOS it doesn’t work. There’s nothing stopping you selecting any date.

That’s nothing to do with the web components. It turns out that Safari on iOS doesn’t support min and max on date inputs. This is also true of any other browser on iOS because they’re all just Safari in a trenchcoat …for now.

I was surprised — input type="date" has been around for a long time now. I mean, it’s not the end of the world. You’d have to do validation on inputted dates on the server anyway, but it sure would be nice for the user experience of filling in forms.

Alas, it doesn’t look like this is something on the interop radar.

What really surprised me was looking at Can I Use. That shows Safari on iOS as fully supporting date inputs.

Maybe it’s just semantic nitpickery on my part but I would consider that the lack of support for the min and max attributes means that date inputs are partially supported.

Can I Use gets its data from here. I guess I need to study the governance rules and try to figure out how to submit a pull request to update the currently incorrect information.

Have you published a response to this? :

Responses

Dan Burzo

@adactio I was surprised to find a different date picking UI than I remember. iOS Safari had that slot-machine day-month-year picker that enforced `min` and `max` in a very frustrating way. Maybe a better equivalent is in the works for the new UI?

# Posted by Dan Burzo on Tuesday, April 16th, 2024 at 8:45am

Curtis Wilcox

@adactio This other CanIUse page says “Partial” in part because mobile Safari permits the selection of dates prior to `min` and after `max`. That’s what ios404.com is citing.

https://caniuse.com/input-datetime

However, MDN may not include that qualifier for `input=date` because mobile Safari does support use of the attributes for form validation.

https://bugs.webkit.org/show_bug.cgi?id=223128

https://codepen.io/ccwilcox/pen/abxaLMM?editors=1010

Date and time input types | Can I use… Support tables for HTML5, CSS3, etc

5 Shares

# Shared by Sebastian Laube on Tuesday, April 16th, 2024 at 8:47am

# Shared by Paul Kinlan on Tuesday, April 16th, 2024 at 9:14am

# Shared by Baldur Bjarnason on Tuesday, April 16th, 2024 at 9:40am

# Shared by crashposition on Tuesday, April 16th, 2024 at 10:43am

# Shared by Thomas Steiner :chrome: on Wednesday, April 17th, 2024 at 6:35am

6 Likes

# Liked by Dan Burzo on Tuesday, April 16th, 2024 at 9:13am

# Liked by Andrew Maier on Tuesday, April 16th, 2024 at 9:40am

# Liked by lilo on Tuesday, April 16th, 2024 at 10:43am

# Liked by Alex 🍜 on Tuesday, April 16th, 2024 at 12:55pm

# Liked by Kai on Wednesday, April 17th, 2024 at 8:40am

# Liked by Pierre Spring on Wednesday, April 17th, 2024 at 7:03pm

Related posts

Installing web apps

Here’s an HTML web component you can use if you’re participating in the origin trial for the Web Install API.

Speaking at Web Day Out

Have you got the perfect talk for this event? Let me know!

Announcing Web Day Out

A one-day event all about what you can in web browsers today: Brighton, March 12th, 2026. Tickets are just £225+VAT!

Making the website for Research By The Sea

Having fun with view transitions and scroll-driven animations.

Preventing automated sign-ups

Here’s a bit of PHP I’m using on The Session.

Related links

Two Paradigms for Enhancing HTML Tags | That HTML Blog

This really gets to the heart of one of the biggest benefits of HTML web components: composability. You can nest your regular markup inside multiple custom elements; something that is can’t do.

The other exciting approach doesn’t exist yet: custom attributes. Again, they’d be a great way of using composability to turbo-charge your existing HTML in all sorts of ways.

Tagged with

Tagged with

Alistair Davidson / validation-enhancer · GitLab

Here’s another nice progressive web component for your forms, this time for showing error messages.

Tagged with

Never Lose Form Progress Again :: Aaron Gustafson

Here’s an excellent progressive web component from Aaron—wrap a custom element around your exising form and your good to go:

At its core, form-saver is a small web component that wraps a form, keeps an eye on it, stores values in localStorage, and restores them when the page loads again. Better yet, it clears out saved data after a successful submission so you’re not accidentally resurrecting stale information the next time someone stops by.

Tagged with

The Great CSS Expansion | Butler’s Log

Web development follows a familiar cycle. First we glue together a solution with whatever we have — JavaScript, image hacks, Flash, anything. Then the platform matures, and CSS or HTML eventually makes that same workaround native. Rounded corners, custom fonts, smooth scrolling, sticky positioning: all of these started as JavaScript-heavy hacks before CSS turned them into a single declaration.

We are in another one of those transition moments. A new wave of long-requested CSS features is finally landing, and many of them are explicitly designed to replace patterns that used to require JavaScript. Not as approximations — as first-class platform primitives that handle the edge cases, run in the right thread, and need zero dependencies.

Tagged with

Previously on this day

6 years ago I wrote Podcasts

Four audio outings.

7 years ago I wrote Three more Patterns Day speakers

Three fantastic speakers have been added to the roster of this year’s unmissable one-day event dedicated to design systems, pattern libraries, style guides, and components.

11 years ago I wrote 100 words 025

Day twenty five.

15 years ago I wrote The Kindle connection

For all the faults with its digital books, this little device is proving its worth.

19 years ago I wrote Fake tales of San Francisco

The biggest small town in the West.

20 years ago I wrote Adactio, pour homme

The perfume of the movie of the website… you read it here first.

21 years ago I wrote Transparent liquid

Good design doesn’t draw attention to itself. Really good design is invisible.

22 years ago I wrote Revenge of the DOM

There’s a new article up at A List Apart called Let Them Eat Cake. It’s all about using JavaScript, or more accurately the Document Object Model, to hide and show content on demand.

23 years ago I wrote Hot days, crazy nights

It was a gorgeously hot sunny day today.

24 years ago I wrote Best domain name ever

www.We Made Out in a Tree and This Old Guy Sat and Watched Us.com

24 years ago I wrote Hard times

I’m flattered to be mentioned in the same sentence as Jeffrey Zeldman. Mind you, I am referred to as being "british and poetic", neither of which are quite true.