<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>238626</bug_id>
          
          <creation_ts>2022-03-31 12:29:21 -0700</creation_ts>
          <short_desc>[JSC] Support non-spec-required date+time input, white-space delimited time (`YYYY-MM-DD HH:mm:ss`) as an extension</short_desc>
          <delta_ts>2022-04-06 03:23:40 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>JavaScriptCore</component>
          <version>Safari 15</version>
          <rep_platform>iPhone / iPad</rep_platform>
          <op_sys>iOS 15</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>DUPLICATE</resolution>
          <dup_id>235468</dup_id>
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>strarsis</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>msaboff</cc>
    
    <cc>saam</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1856921</commentid>
    <comment_count>0</comment_count>
    <who name="">strarsis</who>
    <bug_when>2022-03-31 12:29:21 -0700</bug_when>
    <thetext>On `iOS`/`iPad` Safari browser engine the JavaScript `Date` fails to parse `ISO 8601` date+time inputs where the date and time are delimited by a white-space instead of the `T` character (e.g. `2022-03-22 17:51:57`): 
The `Date` constructor fails with `Invalid date format`.

The usage of a white-space as delimiter between date and time isn&apos;t specified by ISO 8601, but is allowed by the RFC that is mostly used on the web.
Most Browsers and JavaScript libraries support and output `ISO 8601` formatted dates with date+time delimited by a white-space (`Chrome` (`Blink`/`Chromium`); `Firefox` (`Gecko`); `FeathersJS`; ...).

Code demonstration: `new Date(&apos;2022-03-22 17:51:57&apos;)`
Live demonstration: https://playcode.io/879708/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1856923</commentid>
    <comment_count>1</comment_count>
      <attachid>456271</attachid>
    <who name="">strarsis</who>
    <bug_when>2022-03-31 12:31:04 -0700</bug_when>
    <thetext>Created attachment 456271
Live demonstration of the issue</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1858722</commentid>
    <comment_count>2</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2022-04-06 01:34:02 -0700</bug_when>
    <thetext>(In reply to strarsis from comment #0)
&gt; On `iOS`/`iPad` Safari browser engine the JavaScript `Date` fails to parse
&gt; `ISO 8601` date+time inputs where the date and time are delimited by a
&gt; white-space instead of the `T` character (e.g. `2022-03-22 17:51:57`): 
&gt; The `Date` constructor fails with `Invalid date format`.
&gt; 
&gt; The usage of a white-space as delimiter between date and time isn&apos;t
&gt; specified by ISO 8601, but is allowed by the RFC that is mostly used on the
&gt; web.

Note that ECMAScript spec is &quot;date-times based upon a simplification of the ISO 8601&quot;[1], not a ISO 8601 or RFC. So using space here is implementation-dependent behavior (spec only accepts &quot;T&quot; case.)

But it can be a good extension.

[1]: https://tc39.es/ecma262/#sec-date-time-string-format</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1858751</commentid>
    <comment_count>3</comment_count>
    <who name="Yusuke Suzuki">ysuzuki</who>
    <bug_when>2022-04-06 03:23:40 -0700</bug_when>
    <thetext>Ah, I extended it in bug 235468.

*** This bug has been marked as a duplicate of bug 235468 ***</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>456271</attachid>
            <date>2022-03-31 12:31:04 -0700</date>
            <delta_ts>2022-03-31 12:31:04 -0700</delta_ts>
            <desc>Live demonstration of the issue</desc>
            <filename>file_238626.txt</filename>
            <type>text/plain</type>
            <size>32</size>
            <attacher>strarsis</attacher>
            
              <data encoding="base64">bmV3IERhdGUoJzIwMjItMDMtMjIgMTc6NTE6NTcnKTs=
</data>

          </attachment>
      

    </bug>

</bugzilla>