#microformats 2022-02-04

2022-02-04 UTC
darkkirb, strugee, jacky, gRegorLove_ and [tw2113_Slack_] joined the channel
#
jacky
so I'm noticing (and I'm sure that this is by design) that there's no normalization of date values when they're being parsed
#
jacky
so dates are more to 'match' the expression than needing to be valid, it seems?
#
jacky
looking at the php parser, it seems to be mainly thar
#
jacky
*thart
gRegorLove_ joined the channel
#
[tantek]
there *is* normalization, just not to artificial precision. that's the key
#
[tantek]
language date parsers do this really dumb thing (numerically) of always implying artificial precision of seconds when there is none in the input data
gRegorLove_, [metbril], ur5us, metbril1 and jamietanna joined the channel
grantcodes[d] and [jacky] joined the channel
#
[jacky]
[tantek] do you mean like if someone provides "2:40 PM", they'd parse it as 14:40:00 or something similar?
#
[jacky]
I've been working to avoid that in the parser I'm working on
#
aaronpk
yes, if you feed a string like "2:40 PM" into many languages date parsers and then output it you'll get the :00 seconds added on
#
[jacky]
yeah that's going to be nigh impossible for me to remove from this (unless I wrap it a bit more)
#
aaronpk
in most cases you can kind of work around it because you know what level of precision is important to display, but it's super annoying when it combines both the date and time
#
sknebel
the parsers thus leave that to downstream consumers to have context about
#
aaronpk
if you give it "2022-02-04" then the date object becomes "2022-02-04 00:00:00" and now you can't tell whether the value had no time or actually was at midnight
#
[KevinMarks]
Also month precision dates are legitimate, and month and day with no year also - for birthdays for example.
jacky joined the channel
#
[tantek]
^ yes all of this, because programmers optimized languages and their functions for math, not human expressed content
#
[KevinMarks]
I used bradfitz's Facebook friend to contacts importer, and it defaulted everyone's birthday to 2000 so they only became able to invite for drinks last year
#
sknebel
...lol
#
capjamesg[d]
Good point re: birthdays [KevinMarks].
#
@ludvikherrera
↩️ Of course, when I mention HTML and content, it should be understood with all the nuance that is implied, from well-structured and written content, image captions, accessibility parameters, tidy and well-structured syntax, not only responsive but adaptive data + microformats.
(twitter.com/_/status/1489641828068569090)
gRegorLove_ and jacky joined the channel
#
[tantek]
that's a good thread
[jgmac1106], KartikPrabhu, Darius_Dunlap[d], KartikPrabhu1, jacky and ur5us joined the channel
#
jacky
implied names are kicking my butt
#
jacky
I can't seem to grab `.items[0].properties.org[0].properties.name`
#
jacky
which is also preventing me from grabbing `.items[0].properties.org[0].value` (because it knows it's a p- property so it'd want a name)
P1000[d] joined the channel
#
[tantek]
taking a look
#
[tantek]
jacky, does your code handle the atomic form <a class="h-card" href="https://mozilla.org/">Mozilla Foundation</a> ? and produce an h-card item object with properties for url and name?
jacky joined the channel
#
jacky
I think it's my parser
cygnoir[d] joined the channel
#
jacky
yeah it's prob me
#
jacky
going to gut the current impl (thanks VCS) and try it again
#
jacky
34/95 isn't so bad
#
jacky
(it's kinda bad, lol)