[OpenAjaxIDE] Add @format=date, time, timestamp

Jon Ferraiolo jferrai at us.ibm.com
Mon Jun 29 09:01:41 PDT 2009


In my last email about "Date" formats, I suggested that we need to add:

@format="date"
@format="time"
@format="timestamp" (or date-time)

I am sending this separate email so that people won't miss this issue
(hidden inside another issue).

Jon


ide-bounces at openajax.org wrote on 06/24/2009 12:37:12 PM:

> [image removed]
>
> Re: [OpenAjaxIDE] "ISO" dates
>
> Jon Ferraiolo
>
> to:
>
> Scott Richards
>
> 06/24/2009 12:43 PM
>
> Sent by:
>
> ide-bounces at openajax.org
>
> Cc:
>
> "ide at openajax.org"
>
> Yes, I agree that we need to allow people to select dates from
> calendar widgets. This is a very common thing for people to do!
>
> But the issue right now is what value strings to allow within the
> @defaultValue attribute when @datatype="Date". It's a nitpicky spec
> issue that turns out to be non-obvious. Adam has pointed out that
> @defaultValue="2009-05-01" is ambiguous and likely to cause errors
> and confusion in some circumstances. If a tool equates 2009-05-01 to
> 2009-05-01T00:00.00Z, and if the user is in Honolulu, the computed
> date-time will be approximately noon on the previous day (i.e.,
> 2009-04-30). To avoid these types of errors, I am recommending that
> you must provide timezone information for @defaultValue when
@datatype="Date".
>
> But we do have to think through whether we have dealt adequately
> with the needs of calendar widgets (which select just the date) and
> time-of-day widgets (which just select the time). I am wondering if
> I made a bad recommendation yesterday when saying we should NOT have
> @format="date", @format="time" and @format="timestamp". It seems to
> me that both IDEs and mashup tools would benefit if they can
> distinguish between properties and topics that were meant for dates vs
times.
>
> Jon
>
>
>
> [image removed] Scott Richards ---06/24/2009 12:20:52 PM---I think
> there are applications where you will want to specify a date without
> a time. The example I c

>
> [image removed]
> From:
>
> [image removed]
> Scott Richards <scrichar at adobe.com>
>
> [image removed]
> To:
>
> [image removed]
> Jon Ferraiolo/Menlo Park/IBM at IBMUS, Adam Peller/Cambridge/IBM at IBMUS
>
> [image removed]
> Cc:
>
> [image removed]
> "ide at openajax.org" <ide at openajax.org>
>
> [image removed]
> Date:
>
> [image removed]
> 06/24/2009 12:20 PM
>
> [image removed]
> Subject:
>
> [image removed]
> RE: [OpenAjaxIDE] "ISO" dates
>
>
>
>
> I think there are applications where you will want to specify a date
> without a time. The example I can think of is where you want to
> specify a particular date as being selected in a calendar.  In this
> scenario you should not be required to specify the time.  So I think
> there should be support the short format.
>
> -Scott
>
> From: ide-bounces at openajax.org [mailto:ide-bounces at openajax.org] On
Behalf Of
> Jon Ferraiolo
> Sent: Wednesday, June 24, 2009 12:14 PM
> To: Adam Peller
> Cc: ide at openajax.org
> Subject: Re: [OpenAjaxIDE] "ISO" dates
> Good point about potential problems a separate 'date' format. This
> is just for the 'defaultValue' attribute when @datatype="Date", so
> IMO it's OK to require people to write out the long form (e.g.,
> 1985-04-12T23:20:50.52Z) and drop the short form (1985-04-12).
>
> Regarding case (T/t and Z/z) and spaces, I would recommend that our
> spec say that values SHOULD use upper case and not use spaces. (As I
> remember, RFC3339 also says content SHOULD use uppercase.)
>
> So, I'm thinking we normatively reference RFC3339, but include text
> telling developers to use upper case T and Z and not use space instead of
T.
>
> Jon
>
>
> [image removed] Adam Peller---06/24/2009 09:32:35 AM---A problem is
> that in languages without a separate "date" type from "datetime",
> representing a Date w
>
>
> From:
>
>
> Adam Peller/Cambridge/IBM
>
>
> To:
>
>
> Jon Ferraiolo/Menlo Park/IBM at IBMUS
>
>
> Cc:
>
>
> Bertrand Le Roy <Bertrand.Le.Roy at microsoft.com>, "ide at openajax.org"
> <ide at openajax.org>
>
>
> Date:
>
>
> 06/24/2009 09:32 AM
>
>
> Subject:
>
>
> Re: [OpenAjaxIDE] "ISO" dates
>
>
>
>
> A problem is that in languages without a separate "date" type from
> "datetime", representing a Date without a time is tricky business.
> You'd either have to use UTC or local time, and depending on how you
> interact with the date, you may end up with a different day on the
> round-trip. Is that an implementation detail? I suppose it is, but
> it's a mismatch that's likely to cause user error. I think RFC3339
> avoids this issue by allowing only date-time.
>
> There are at least two details which are not a strict subset of what
> will likely be in ES5: RFC3339 apparently allows spaces to be used
> in place of T. The only other issue I saw was the part about being
> case-insensitive. Apparently, this is valid in RFC3339 but not in
> TC39, but I've never seen it used.
>
> 1985-04-12t23:20:50.52z
>
> I guess we could call out that uppercase must be used (Atomdoes this)
> Here's a note about the Atom spec, which calls out some other details
>
> http://www.imc.org/atom-syntax/mail-archive/msg13103.html
>
> Oh joy, so there's another variant, xsd:dateTime
>
> http://www.w3.org/TR/xmlschema11-2/#dateTime
>
> -Adam
>
>
>
> [image removed] Jon Ferraiolo---06/24/2009 12:12:04 PM---What's the
> downside to having a normative reference to RFC3339? I read through
> that spec and it seem
>
> Jon Ferraiolo/Menlo Park/IBM
> 06/24/2009 12:04 PM
>
> To
>
>
> Adam Peller/Cambridge/IBM at IBMUS
>
> cc
>
>
> Bertrand Le Roy <Bertrand.Le.Roy at microsoft.com>, "ide at openajax.org"
> <ide at openajax.org>
>
> Subject
>
>
> Re: [OpenAjaxIDE] "ISO" dates[image removed]
>
> [image removed]
>
> [image removed]
>
> What's the downside to having a normative reference to RFC3339? I
> read through that spec and it seems entirely suitable and appears to
> be a proper subset of what is in the latest draft of TC39. We could
> say that when datatype="Date" then the 'defaultValue' attribute must
> conform to either the full-date syntax or the date-time production
> from RFC3339.
>
> For everyone's reading convenience, here is a copy/paste of the ABNF
> definitions from RFC3339:
>
> date-fullyear = 4DIGIT
> date-month = 2DIGIT ; 01-12
> date-mday = 2DIGIT ; 01-28, 01-29, 01-30, 01-31 based on
> ; month/year
> time-hour = 2DIGIT ; 00-23
> time-minute = 2DIGIT ; 00-59
> time-second = 2DIGIT ; 00-58, 00-59, 00-60 based on leap second
> ; rules
> time-secfrac = "." 1*DIGIT
> time-numoffset = ("+" / "-") time-hour ":" time-minute
> time-offset = "Z" / time-numoffset
>
> partial-time = time-hour ":" time-minute ":" time-second [time-secfrac]
> full-date = date-fullyear "-" date-month "-" date-mday
> full-time = partial-time time-offset
>
> date-time = full-date "T" full-time
>
> Here are some examples from RFC3339:
>
> 1985-04-12T23:20:50.52Z
> 1996-12-19T16:39:57-08:00
> 1990-12-31T23:59:60Z
> 1990-12-31T15:59:60-08:00
> 1937-01-01T12:00:27.87+00:20
>
> I propose that our spec allows either "date-time" (examples shown
> above) or "full-date" (i.e., YYYY-MM-DD) values, such as:
>
> 1985-04-12
>
> Jon
>
>
> [image removed] Adam Peller---06/23/2009 07:25:14 PM---Referencing
> some other spec sounds like a good way to go. It's tempting just to
> go with RFC3339, if
>
>
> From:
>
>
> Adam Peller/Cambridge/IBM
>
>
> To:
>
>
> Jon Ferraiolo/Menlo Park/IBM at IBMUS
>
>
> Cc:
>
>
> Bertrand Le Roy <Bertrand.Le.Roy at microsoft.com>, "ide at openajax.org"
> <ide at openajax.org>
>
>
> Date:
>
>
> 06/23/2009 07:25 PM
>
>
> Subject:
>
>
> Re: [OpenAjaxIDE] "ISO" dates
>
>
>
>
> Referencing some other spec sounds like a good way to go. It's
> tempting just to go with RFC3339, if that's a strict subset and
> sufficient for our needs (is it?) I'm concerned about silly little
> details like the fact that it allows a lowercase 't' separator and
> perhaps other small differences I didn't pick up on. Do most specs
> use RFC3339 or just make up their own profiles? I'm not sure.
>
> Another alternative is to just have some faith and reference the ES5
> spec and go with whatever the final draft says... Upon reviewing
> this part of the spec this evening, I saw a couple issues which I
> had raised earlier with TC39 which seem to be unresolved (in
> particular, what it means to specify a partial date now that there's
> no longer a default date property on the parse method) I'll try to
> get clarification on this and perhaps they'll put out an updated spec.
>
> -Adam
>
>
>
> [image removed] Jon Ferraiolo---06/23/2009 07:20:05 PM---Even though
> it isn't a good idea to normatively reference a draft specification,
> in this case, I thi
>
> Jon Ferraiolo/Menlo Park/IBM
> 06/23/2009 07:19 PM
>
> To
>
>
> Bertrand Le Roy <Bertrand.Le.Roy at microsoft.com>, Adam Peller/
> Cambridge/IBM at IBMUS, "ide at openajax.org" <ide at openajax.org>
>
> cc
>
> [image removed]
>
> Subject
>
>
> Re: [OpenAjaxIDE] "ISO" dates[image removed]
>
> [image removed]
>
> [image removed]
>
> Even though it isn't a good idea to normatively reference a draft
> specification, in this case, I think it's OK. We can normatively
> reference the definition of "Simplified ISO 8601" found within the
> tc39-2009-025.pdf draft specification. That draft specification will
> be preserved for eternity, even as subsequent newer drafts appear.
> It seems unlikely that this part of the specification will change,
> and even if it does, our syntax will be defined as what exists in
> the ECMA5 spec today.
>
> Anyone see a problem with that approach? The alternative approach
> would be to write about a page's worth of text in our spec that
> redefines "Simplified ISO 8601" in our own words (to avoid having to
> ask ECMA for permission to copy their text), but why not take the
> simple and direct approach of referencing the ECMA5 draft spec.
>
> Jon
>
>
>
>
> [image removed] Bertrand Le Roy ---06/23/2009 03:08:17 PM---Using
> *a* ISO format such as the one in the json2 example sounds
> reasonable. Supporting the whole sp
>
>
> From:
>
>
> Bertrand Le Roy <Bertrand.Le.Roy at microsoft.com>
>
>
> To:
>
>
> Adam Peller/Cambridge/IBM at IBMUS, "ide at openajax.org" <ide at openajax.org>
>
>
> Date:
>
>
> 06/23/2009 03:08 PM
>
>
> Subject:
>
>
> Re: [OpenAjaxIDE] "ISO" dates
>
>
> Sent by:
>
>
> ide-bounces at openajax.org
>
>
>
>
>
> Using *a* ISO format such as the one in the json2 example sounds
> reasonable. Supporting the whole spec seems unnecessarily complex.
> (I don’t know what browsers support or plan to support ISO dates but
> there are a few libraries out there that can do quite a lot of heavy
> date parsing.)
>
> From: ide-bounces at openajax.org [mailto:ide-bounces at openajax.org] On
Behalf Of
> Adam Peller
> Sent: Tuesday, June 23, 2009 2:52 PM
> To: ide at openajax.org
> Subject: [OpenAjaxIDE] "ISO" dates
> ISO8601 is a somewhat complex and includes date ranges, weeks of the
> year, etc. iirc, you need to pay ISO for a hard copy of the spec. A
> simple subset or "profile" of ISO8601 is often used on the web to
> represent datetimes. I've highlighted the ones I know of below and
> attempted to summarize. The formatting is orthogonal to the timezone
> used to represent the datetime, which may be UTC/GMT/Z (there may be
> subtle differences between these things?!) or in some cases
> unspecified to represent local time.
>
> w3 datetime note (1997): http://www.w3.org/TR/NOTE-datetime
> Permits 'zulu' as well GMT offsets or just "local" time. Also
> permits partial representations like YYYY-MM (but not a time without
> a date?) No milliseconds.
> rfc3339 (2002): http://www.ietf.org/rfc/rfc3339.txt
> Must be a fully qualified datetime as zulu or GMT offset; no local
> time. Case insensitive. Millis optional.
> Crockford's json2.js (2009): http://www.json.org/json2.js
> Provides a Date.toJSON method which produces a full datetime in
> zulu, no millis. Provides a sample reviver function to parse
> rfc3339-like datetimes.
> es5 final candidate draft (2009): http://www.ecma-international.org/
> publications/files/drafts/tc39-2009-025.pdf
> See section 15.9.1.15. The Date constructor calls parse() which
> supports the ISO 8601 subset. Permits partial dates or partial times
> (?) as well as datetimes. Millis optional.
> Date.prototype.toISOString outputs a datetime in zulu.
> Date.prototype.toJson calls toISOString.
>
> The ISO standard supports more flexible syntax, like a space instead
> of "T", often used by SQL, also a 'compact' format without dashes or
> colons. I don't think any of the above do.
>
> Firefox 3.1 supports toISOString() but doesn't seem to support
> parse. I'm not sure any of the other browser vendors have
> implemented this ES5 feature yet.
>
> Hope that helps.
>
> Adam_______________________________________________
> IDE mailing list
> IDE at openajax.org
> http://openajax.org/mailman/listinfo/ide
> _______________________________________________
> IDE mailing list
> IDE at openajax.org
> http://openajax.org/mailman/listinfo/ide
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://openajax.org/pipermail/ide/attachments/20090629/fa53014d/attachment-0001.html 


More information about the IDE mailing list