Skip to content

Commit

Permalink
Review fixes, thanks @ptomato
Browse files Browse the repository at this point in the history
  • Loading branch information
cjtenny committed Apr 13, 2021
1 parent 8fe0778 commit 9728a8c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 10 deletions.
10 changes: 4 additions & 6 deletions docs/duration.md
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,7 @@ d = Temporal.Duration.from('PT59.999999999S');
d.toString({ smallestUnit: 'seconds' }); // => PT59S
d.toString({ fractionalSecondDigits: 0 }); // => PT59S
d.toString({ fractionalSecondDigits: 4 }); // => PT59.9999S
d.toString({ fractionalSecondDigits: 8, roundingMode: 'halfExpand });
d.toString({ fractionalSecondDigits: 8, roundingMode: 'halfExpand' });
// => PT60.00000000S
```

Expand Down Expand Up @@ -673,13 +673,11 @@ The `locales` and `options` arguments are the same as in the constructor to [`In
> If `Intl.DurationFormat` is not available, then the output of this method is the same as that of `duration.toString()`, and the `locales` and `options` arguments are ignored.
Usage examples:

TODO FIXME CURRENTLY NOT SPECIFIED, should we remove?
```javascript
d = Temporal.Duration.from('P1DT6H30M');
d.toLocaleString(); // => '1 day 6 hours 30 minutes'
d.toLocaleString('de-DE'); // => '1 Tag 6 Stunden 30 Minuten'
d.toLocaleString('en-US', { day: 'numeric', hour: 'numeric' }); // => '1 day 6 hours'
d.toLocaleString(); // example output: '1 day 6 hours 30 minutes'
d.toLocaleString('de-DE'); // example output: '1 Tag 6 Stunden 30 Minuten'
d.toLocaleString('en-US', { day: 'numeric', hour: 'numeric' }); // example output: '1 day 6 hours'
```

### duration.**valueOf**()
Expand Down
5 changes: 2 additions & 3 deletions docs/instant.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ instant === Temporal.Instant.from(instant); // => false

// Not enough information to denote an exact time:
/* WRONG */ instant = Temporal.Instant.from('2019-03-30'); // => throws, no time
/* WRONG */ instant = Temporal.Instant.from('2019-03-30T01:45'); // => throws, no time
/* WRONG */ instant = Temporal.Instant.from('2019-03-30T01:45'); // => throws, no time zone
```
<!-- prettier-ignore-end -->

Expand Down Expand Up @@ -627,8 +627,7 @@ Example usage:

```js
instant = Temporal.Instant.from('2019-11-18T11:00:00.000Z');
instant.toLocaleString(); // example output: '11/18/2019, 3:00:00 AM'
// (if host environment's current locale is 'en-US')
instant.toLocaleString(); // example output: '2019-11-18, 3:00:00 a.m.'
instant.toLocaleString('de-DE'); // example output: '18.11.2019, 03:00:00'
instant.toLocaleString('de-DE', {
timeZone: 'Europe/Berlin',
Expand Down
2 changes: 1 addition & 1 deletion docs/plainyearmonth.md
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ Usage example:
// Attempt to write some mnemonic poetry
const monthsByDays = {};
for (let month = 1; month <= 12; month++) {
const ym = Temporal.PlainYearMonth.from({ year: 2020, calendar: 'iso8601', month });
const ym = Temporal.PlainYearMonth.from({ year: 2020, calendar: 'iso8601', month });
monthsByDays[ym.daysInMonth] = (monthsByDays[ym.daysInMonth] || []).concat(ym);
}

Expand Down

0 comments on commit 9728a8c

Please sign in to comment.