<?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>185563</bug_id>
          
          <creation_ts>2018-05-11 14:09:38 -0700</creation_ts>
          <short_desc>TimeClip&apos;s incorrect ToInteger</short_desc>
          <delta_ts>2018-05-14 08:05:14 -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>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Leo Balter">leo</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1423253</commentid>
    <comment_count>0</comment_count>
    <who name="Leo Balter">leo</who>
    <bug_when>2018-05-11 14:09:38 -0700</bug_when>
    <thetext>From the test262 runner (https://build.webkit.org/builders/Apple%20Sierra%20Release%20Test262%20%28Tests%29/builds/2187/steps/test262-test/logs/stdio)

- test/intl402/DateTimeFormat/prototype/format/time-clip-to-integer.js
- test/intl402/DateTimeFormat/prototype/formatToParts/time-clip-to-integer.js

Intl.DateTimeFormat#format calls are not properly extracting the ToInteger value from its first argument.

```
var dtf = new Intl.DateTimeFormat(undefined, {
    hour: &quot;numeric&quot;, minute: &quot;numeric&quot;, second: &quot;numeric&quot;
});


dtf.format(-0.9) // expects dtf.format(0)
```

Currently returning the same as `dtf.format(-1)`

---

Also affects Intl.DateTimeFormat#formatToParts:


```
var dtf = new Intl.DateTimeFormat(undefined, {
    hour: &quot;numeric&quot;, minute: &quot;numeric&quot;, second: &quot;numeric&quot;
});

function formatAsString(dtf, time) {
    return dtf.formatToParts(time).map(part =&gt; part.value).join(&quot;&quot;);
}


formatAsString(dtf, -0.9) // expects formatAsString(dtf, 0)
```

Currently returning the same as `formatAsString(dtf, -1)`</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1423606</commentid>
    <comment_count>1</comment_count>
    <who name="Leo Balter">leo</who>
    <bug_when>2018-05-14 08:04:03 -0700</bug_when>
    <thetext>Sounds like this is fixed by the Bug 185578 / https://trac.webkit.org/changeset/231740</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1423607</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2018-05-14 08:05:14 -0700</bug_when>
    <thetext>&lt;rdar://problem/40217650&gt;</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>