Skip to content

Updating calendar-draft.md with recent data model conclusions#487

Merged
sffc merged 5 commits intomainfrom
calendar-update
Mar 31, 2020
Merged

Updating calendar-draft.md with recent data model conclusions#487
sffc merged 5 commits intomainfrom
calendar-update

Conversation

@sffc
Copy link
Copy Markdown
Collaborator

@sffc sffc commented Mar 30, 2020

@sffc sffc requested review from ptomato and ryzokuken March 30, 2020 18:17
@codecov
Copy link
Copy Markdown

codecov bot commented Mar 30, 2020

Codecov Report

Merging #487 into main will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #487      +/-   ##
==========================================
- Coverage   96.59%   96.58%   -0.02%     
==========================================
  Files          17       17              
  Lines        3705     3694      -11     
  Branches      558      558              
==========================================
- Hits         3579     3568      -11     
  Misses        124      124              
  Partials        2        2              
Flag Coverage Δ
#test262 49.94% <100.00%> (+0.45%) ⬆️
#tests 92.16% <100.00%> (-0.03%) ⬇️
Impacted Files Coverage Δ
polyfill/lib/date.mjs 92.51% <100.00%> (ø)
polyfill/lib/time.mjs 96.47% <100.00%> (-0.05%) ⬇️
polyfill/lib/yearmonth.mjs 96.62% <100.00%> (-0.18%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3e8b2a9...d2f4376. Read the comment docs.

Copy link
Copy Markdown
Member

@littledan littledan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall LGTM; no disagreement about content, and from my perspective, you could land as is. I have some suggestions to improve clarity. Thanks for making these improvements.


Main issue: https://github.com/tc39/proposal-temporal/issues/403

If properties of Temporal.Date, etc., are to be enumerable, the calendar should choose which properties to expose; for example, the Japanese calendar might choose to make `.era` enumerable, whereas other calendars might not. This operation can cake place in the factory methods of the Temporal.Calendar protocol, such as `.dateFromFields()`.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The explanation of why "era" should be enumerable is not reflected in the issue. Could you summarize this in an issue comment? (Also another part of the issue is whether other fields should be enumerable--IMO we should follow normal JS conventions and make none of them enumerable; I've expressed this in the issue.)

I want to suggest that we simply link to this issue, and work on improving the content/discussion there, rather than summarizing it here, as we may get out of date/sync quickly, and it's hard to follow that issue.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I removed the aside about era and moved it to the issue.

This doc describes a design for first-class support for non-Gregorian [calendars](https://en.wikipedia.org/wiki/Calendar) in Temporal. Although most of this document is based on Temporal.Date, most of this applies to Temporal.DateTime, Temporal.YearMonth, Temporal.MonthDay, and Temporal.Time as well.

## Temporal.Date internal slots
## Data Model
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to describe what you mean here by IsoYear, etc; I think this might be confusing for people.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added another paragraph

- `[[IsoYear]]`
- `[[IsoMonth]]`
- `[[Calendar]]`
- `[[RefIsoDay]]`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Ref" would also be good to explain.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a sentence


For calendars that use ISO-style months, such as Gregorian, Solar Buddhist, and Japanese, "RefIsoDay" and "RefIsoYear" can be ignored. However, for lunar and lunisolar calendars, such as Hebrew, Saudi Arabian Islamic, and Chinese, these additional fields allow those calendars to disambiguate which YearMonth and MonthDay are being represented.

## Temporal.Calendar interface
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we also note here that there's a concrete class, Temporal.Calendar, with a constructor that takes a calendar ID (a la 402), and that you can subclass this class (as described in #300)?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this look correct?

Copy link
Copy Markdown
Collaborator

@ptomato ptomato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Co-Authored-By: Philip Chimento <philip.chimento@gmail.com>
Copy link
Copy Markdown
Member

@littledan littledan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great!

@sffc sffc merged commit 7ad61bb into main Mar 31, 2020
@sffc sffc deleted the calendar-update branch March 31, 2020 01:23
@jasonwilliams
Copy link
Copy Markdown
Member

I know its already merged but looks good!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

4 participants