jeapostrophe
2020-9-2 14:06:52

@jaz That code says it is “No Library” but it uses "$", when I try to use it, I get an error that doesn’t exist. Do I need to get a jQuery library?


jeapostrophe
2020-9-2 14:11:23

I’m assuming the answer is yes, same with moment.js


jeapostrophe
2020-9-2 14:11:26

Sorry to bother


jaz
2020-9-2 14:11:36

@jeapostrophe The UI there is pretty confusing, yeah. The libraries are configured in the left-hand side panel under “Resources.” There are actually three libraries used: jQuery, moment.js, and moment-timezone. None of these are exactly necessary, of course, but I’m no longer exactly au courant on what browers support what.


jaz
2020-9-2 14:12:25

moment-timezone, in particular, is only there to make formatting easier and to support the UTC offset name (e.g., “EDT,” “PDT,” and so forth).


jaz
2020-9-2 14:14:14

Without any of those libraries, it’s still easy to parse an ISO8601 string and get back a browser-local Date object.


jeapostrophe
2020-9-2 14:15:20

I’m setting [data-slot-time ,(datetime->iso8601 tz-in-utc)] but this doesn’t have the final Z so my date gets parsed wrong


jeapostrophe
2020-9-2 14:15:39

Is there a different gregor function to get the Z or should I just add it?


jaz
2020-9-2 14:17:41

Ah — okay, since a datetime in Gregor represents a kind of ideal date/time that has no relationship to time zones at all, you don’t get an offset. Instead, you’ll need to use a moment.



jaz
2020-9-2 14:19:54

(Another way to think of it is that a datetime is implicitly local.)


jeapostrophe
2020-9-2 14:24:32

Thank you, I think I did it!



mflatt
2020-9-2 14:27:52

There’s a question of whether the va_list type as an argument is pointer-sized, though. Normally, a va_list will need to hold more than one pointer’s worth of information (except on older platforms like i386, where arguments are all on the stack). But I bet va_list is usually defined as an array type; then, declaring one can have more than a pointer’s worth of data, but it turns into a pointer-sized argument for function calls.


jaz
2020-9-2 17:20:29

By the way, if you want better localization for the time format, you could try Intl.DateTimeFormat instead of using moment.js’s formatting function. That is, something like: var opts = { weekday: "long", hour: "numeric", minute: "numeric", timeZoneName: "short" }; var fmt = new Intl.DateTimeFormat("default", opts); fmt.format(dateObject); That will handle things like locale-aware use of 12 or 24-hour time.


soegaard2
2020-9-2 20:17:30

@michaelmmacleod Nice solution you posted on the mailing list.


michaelmmacleod
2020-9-2 20:24:28

thanks!


josef.richter
2020-9-3 05:42:55

@josef.richter has joined the channel