Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bikeshed thread for civil time prefix #33

Closed
domenic opened this issue Jul 10, 2017 · 54 comments
Closed

Bikeshed thread for civil time prefix #33

domenic opened this issue Jul 10, 2017 · 54 comments

Comments

@domenic
Copy link
Member

domenic commented Jul 10, 2017

Currently the "civil time" types are prefixed with Plain. This is a bit confusing and unclear to me, so I thought it would be worthwhile to start a thread exploring alternatives.

To be clear, this kind of bikeshedding is not a big issue or blocker, and hopefully will not be too frustrating for the proposal authors. But I think it's a discussion worth having.

Some alternatives:

  • Plain
  • Civil
  • Local (I think this is what they were originally called, and I agree it's probably bad)
  • Floating ?
  • Unzoned ?
@maggiepint
Copy link
Member

There was a long thread we closed on this one, but we can re-open I suppose. Most libs do local, and that thread had a strong vote for local, but I personally HATE it, and as of right now I"m championing :-).

I think Plain is much more clear to the user. I would also be okay with Civil.

I don't want local because it implies a location, and that's exactly what these types DON'T have.

@domenic
Copy link
Member Author

domenic commented Jul 10, 2017

I guess my way of working would be to have an open thread for issues that seem contentious and haven't yet been locked down (i.e. gotten committee consensus). That's why I opened this. It's just a personal style of working though, so whatever works best for you as the champion.

Also, it's good to get the reasoning for "not Local" disentangled from that large thread :).

@mattjohnsonpint
Copy link
Collaborator

Yeah, let's keep this thread open so folks have a place to weigh in. "Plain" seems to be obvious to the uninitiated, but I will perhaps ask a few colleagues who are not date-time nerds and see what their reactions are. 😄

I can tell you, though "Local" makes sense as established ISO-8601 terminology, I've had to tell many people over the years that "it doesn't mean local to the computer or the user, it just means local to someone somewhere". Usually this gets a groans and moans reaction... So it's teachable, but not intuitive, in my experience.

Also, it's confusing when other APIs have already appropriated the term "local" to indeed mean "local to the computer". For example, in .NET we have DateTimeKind.Local and TimeZoneInfo.Local. Ruby has Time.now.getlocal. In Python, the recommended package to import to get the local time zone is called tzlocal, etc...

@phueper
Copy link

phueper commented Jul 11, 2017

fwiw... coming from a joda background, i initially liked the Local prefix best... but i can see that it is confusing and unintuitive even if it is established as ISO-8601 terminology ...
But i get used to the Plain prefix pretty quickly... it seems to make sense to me... it is the "plain" date/time object without any associated timezone.. i think that can be explained pretty easily and may seem more intuitive than Local

@mattjohnsonpint
Copy link
Collaborator

mattjohnsonpint commented Jul 11, 2017

I asked two different co-workers who are uninitiated to this space, and they both found PlainDate confusing. The each indicated that "plain" felt like it was special or inferior in some way, and maybe they'd want to use something else. They both did like the term CivilDate, stating that it was clear of intent.

While this is quite a small sample size, I do see their point. One may not be accustomed to seeing the word "Civil", but it tends to invoke the need for a Google or Wikipedia search, rather than assumption.

By the way, both did say "why can't you just call it Date"? Indeed, we could, though I fear it would lead to confusion with the existing Date global. Or am I overthinking that?

@maggiepint
Copy link
Member

maggiepint commented Jul 11, 2017

I'm +1 for Civil if we get consistent feedback that that makes the most sense.

@phueper
Copy link

phueper commented Jul 12, 2017

to my (non-native speaker) ears and mind... Civil Date/Time is the contrary of Military Date/Time ... and i don't see this context here, thus i like Plain or Local much better... but i do see @mj1856 's point about tending to invoke the need to search it or having a look at the docs,
So i guess if the documentation for these types (no matter what they are called) starts with something like "XXX is an immutable representation of a date/time/datetime/... without a time zone." ... anyone is fine :)

I just wonder why we need to come up with something new, knowing, that it will probably lead to discussions (see already two threads in this proposal ;)) when we could be saying, well it's called Local because we base this on ISO-8601 and it is established terminology

@mattjohnsonpint
Copy link
Collaborator

FYI - We switched it to Civil in the readme. We can keep discussing though.

@ljharb
Copy link
Member

ljharb commented Jul 27, 2017

"civil" could mean "nonmilitary", or "polite" - I'm not sure it's the best name.

I personally prefer "local", but I understand the wrongly-implied location in that.

@samuelgoto
Copy link

samuelgoto commented Jul 27, 2017

Can you point us to the thread where you got the data points between Local versus Civil? I'm interested to see how representative that was.

I'm assuming we have also explored not having a prefix at all too? Can you help me understand the challenges (for DateTime and Time, not Date)?

A few thoughts off the top of my head:

  • Civil does bring up "military" vs "nonmilitary", specially in the context of times/timezones
  • There is a bit of a nice symmetry between how we are using the language "global" for the Instant objects and could be using "local" for the non-global one
  • I'm still hoping we would be able to get by without the prefix. Doesn't seem like there is much precedent in other languages or libraries for Civil which worries me.

I'm not sure if this qualifies as bike shedding. Date/Time is going to be largely used and I think that it matters how explainable they are (e.g. are we going to need to clarify what Civil means everytime we introduce Date/Time in tutorials?). Specifically, it is unclear to me the mental model and the relationship between Date and CivilDate (e.g. which one should I use? if the distinction is the "global vs local" property, than should Time and DateTime be the "global"-equivalent of the non-civil dates/times).

@mattjohnsonpint
Copy link
Collaborator

@samuelgoto - understand that with this proposal we would encourage a departure from using the existing Date object. That object can't be removed due to its legacy, but the answer to which to use would always be one from this new set of standard objects.

The previous thread was #11.

As to removing the prefixes:

  • Obviously Date would be confusing as the existing object name would conflict. Even with namespacing or being placed in a module, I think it would be too confusing.
  • Time without any prefix is ambiguous. It would have to be called TimeOfDay to differentiate it as time on a 24-hour clock rather than as elapsed time.
  • DateTime would be ok.

That said, if they all use the same prefix, that also conveys a shared set of behaviors (having no time zone or relationship to a point on a timeline). So there are advantages to having a prefix.

I'm not too worried about military time aspect. Pretty much all other time APIs are based on 24-hour clocks.

Do you have any alternative suggestions?

@lundmikkel
Copy link

Just to join in on an old discussion :)

I think the common prefix is essential, however, I'm still not a big fan of "Civil". I keep thinking of "civilian" (as opposed to military as discussed above) or civilized. Each time I see it, I have to actively think about its meaning.

I currently don't have a better suggestion, and I'm more fond of the Local prefix (purely due til habit), but I see how it's confusing, and I have experienced the same misunderstandings @mj1856 talks about, when newcomers see it the first time.

@hax
Copy link
Member

hax commented Jan 22, 2018

As an non-English speaker, I have no strong opinion on the prefix. But maybe we could use simple words without same prefix:

CalendarDate or CalendarDay
ClockTime or TimeOfDay
DateTime

@simonbuchan
Copy link

Mild 👍 to Calender, or Gregorian if you want to be non-preferential (e.g. later add Islamic*, etc...)

When noodling around this space earlier, I used Isolated to represent e.g. IsolatedWeek (which is a week without a year (basically a week number + first day-of-week)) - when it gets to e.g. IsolatedDateTime it is basically the same thing as current CivilDateTime. Maybe someone else likes this?

@arxpoetica
Copy link

Nobody's voting for Unzoned but I think that's SUPER clear on the surface. Two cents.

@mattjohnsonpint
Copy link
Collaborator

Hello World! Lots of time has passed, and things are starting to pick up steam with the this proposal again. @maggiepint and I have had a lot of discussions about this naming, and I think we've come up with a better alternative.

First, let's reiterate some of the rationale behind the current "civil" name:

  • We need something to distinguish a date-only type from this API from the existing Date standard object.
  • We would like a naming convention that can be applied to the three related types (currently CivilDate, CivilTime and CivilDateTime) in such a way to indicate that they are timezoneless and that "date math" applies. This distinguishes these types from Instant and ZonedInstant, where "time math" along either the universal timeline or some timezone-specific timeline applies.
  • We don't like the prefix Local that is used in Java JSR-310 and friends, because it is too easy to think that "local" means local to a specific environment. Particularly in the web world, it may convey the idea of the browser-local time zone. Additionally, "local" is used in the existing ECMAScript spec, and it would be confusing to have two competing definitions.

We originally chose Civil because it reflects some of these qualities well. However, it's been pointed out that it might get confused with civil time as opposed to "military time". It also carries a political connotation, despite being the intent to be timezoneless. Additionally, I feel that it begs more questions than it answers - "CivilDate? What's that mean?"

So, I'd like to retract my vote and for Civil and offer a simpler prefix instead... Simple.

  • SimpleDate
  • SimpleTime
  • SimpleDateTime

Each of these is exactly what they claim to be. A SimpleDate is just a year, month and day. A SimpleTime is just an hour, minute, second, and fraction thereof. A SimpleDateTime combines the two, but doesn't imply any specific time zone. If you capture a SimpleDateTime from a picker control in a UI and transmit it to the other side of the planet, it will not change its value or meaning. It's just that simple.

Also, I think "simple" is friendlier than alternatives like "basic" or "naive". As developers, we strive to keep things simple, but we often see "basic" as a watered-down version of "advanced", and "naive" seems just insulting (sorry python).

So, do you love it (👍) or hate it (👎)?

@rxaviers
Copy link
Member

rxaviers commented Jul 13, 2018

Simple would be a good name if the opposite was Complex. It seems to me what you're really looking for is Unzoned, because that's the fundamental difference between these functions and their counter-part Instant and ZonedInstant. Isn't it?

If the above is true and Unzoned sounds "weird", it's important to ask if is the name or are the functions themselves that sound/look "weird"? Naming is usually hard, but when it's that hard, it's usually a flag that something is wrong and it's good time to take a step back and rethink the design...

@jodastephen
Copy link

Local is, was, and always will be the best prefix. It has been widely used in the industry for 15 years or more. It was coined by ISO-8601 before that.

There is nothing inherently "simple" about these types. Its a meh prefix, like "base", "basic" or "default" used when you can't think of anything better. Similarly, there isn't anything especially "plain" about the date - its a date, and a date can't be plain or non-plain.

"Civil" is no better, as few are aware of the concept of "civil time". As has been seen, "military" is often seen as the opposite.

"Unzoned" is negative. It is never a good idea to name classes in the negative, particularly one as important as LocalDate. "Naive" is another example of a negative.

The only other prefix I've ever seen which doesn't completely suck (like every other one in this thread) is "Iso", as in IsoDate. It doesn't suck because it says what the type is directly, and also allows for other types like JulianDate or JapaneseDate.

As a reminder, in 18 years of Joda-Time I never received any feedback that "local" was confusing. Its such a key topic and class that it becomes widely used so quickly that the meaning becomes embedded in developers very quickly. All the concerns about dual meanings or confusion are simply not borne out in my experience. Consistency across Java and JS would be incredibly valuable to the industry. Please put personal preferences aside and look at the bigger picture here.

Finally, I reread #11. In my opinion, any neutral observer would say that the discussion was clearly in favour of Local and all of my comments received significant positive support.

@mattjohnsonpint
Copy link
Collaborator

mattjohnsonpint commented Jul 13, 2018

First, thanks for our feedback Stephen. As always, it is greatly appreciated.

With regard to the confusion around the term "local" in Java time APIs, here is at least one example. I'm sure I could locate others.

In the .NET space we've encountered this with NodaTime also, example here, despite having clear guidance in the user guide.

If we chose "local" as the prefix in ECMAScript, we would probably need wording such as to distinguish local in this context meaning timezoneless as compared to other places in the spec where it means belonging to the local computer. The main areas being 20.3.1.7: LocalTZA and 20.3.1.8: LocalTime, but also many other scattered locations throughout.

I'd be very interested if you have some thoughts about how to reconcile the terminology in a way that is consistent?

@jodastephen
Copy link

jodastephen commented Jul 19, 2018

On the first point, people make mistakes with all APIs, they learn and they move on. The concepts here are not particularly hard for anyone willing to think a little. The biggest problem is focussing on LocalDateTime, which is the trickiest of the concepts to grasp. As I said in #7, your best plan of action in moving this forward is to change ZonedInstant to ZonedDateTime and drop LocalDateTime/PlainDateTime/CivilDateTime (keeping LocalDate and LocalTime). That way you don't have to explain the complex meaning of LocalDateTime. Maybe in a few years you'll add it back in once people have grasped the concept of LocalDate and LocalTime.

On the second point, you are moving the platform from a world-view based solely on instants to one based on specific types. Those methods/concepts are not wrong, just from a different world view. (Hence use of "time" in APIs that should use "instant", the same problem is found in Java.)

On 2.0.3.1.7 and 8, I don't really see the problem. Those methods provide the ability to convert from a UTC millisecond instant to a "local millisecond instant" (t-local). If you took that "local millisecond instant" and sent the value across the network to another machine and converted it back to UTC there, the UTC millisecond would probably change (as the machines would have different time zones). ie. the result of LocalTime(t) is what I would call a LocalInstant (not really a LocalDateTime) - it has lost the information about the time zone.

As such, I consider those methods to be entirely consistent with using a "Local" prefix, and in fact help make the case for doing so.

@docent
Copy link

docent commented Aug 24, 2018

Dropping my 2 cents (as mainly a Java dev) - found this thread looking for an equivalent of LocalDate for JS. At a glance, the Civil prefix doesn't explain anything, it only brings more confusion. (Civil? So not military?). I don't see anything wrong with Local prefix. It might not be perfect, but the alternatives are even worse/more confusing. I witnessed the introduction of JSR310 to Java and never had any trouble with understanding the new Local* classes.

@mattjohnsonpint
Copy link
Collaborator

mattjohnsonpint commented Sep 25, 2018

I'm coming around to "local". While some may be confused at first about it not being related to the local time zone, we can address that in documentation. Unless there are strong objections - I would like to rename all Civil prefixes to Local.

update: Me calling for renaming was premature. Sorry for that. We can keep things as-is until settling the debate. Thanks.

@ntkoopman
Copy link

Maybe it's because I'm not a native speaker, but even looking at the dictionary, I don't see how Civil makes sense in this context.

Reading all the discussion here, none of the prefixes except Unzoned make much sense to me, but at least Local has precedent. And I fully agree with jodastephen that we should aim for cross language naming concepts.

@hax
Copy link
Member

hax commented Sep 28, 2018

After reading all recent comments, I would like to choose Unzoned because it's the most clear, straightforward and no ambiguity in all current options.

Though Local has precedent, it will certainly introduce confusion to JS programmers/Web developers.

As a non-English speaker, I hope you also notice the translation problem. The confusion may spread to translations. And, the confusion may be much serious in different languages than English. For example, when you see LocalDate you know it's definitely mean unzoned date, and if you see local date, it probably mean date with local timezone. But in Chinese, which do not use space as word boundary and no letter capitalization, both local date and LocalDate will be translated to 本地日期, literally. Because of that, I will imagine some will use a literal translation (本地日期), some will try to use a liberal translation (无时区日期 which is a literal translation of unzoned date). As always, the disagreement of the translated form of terms will make the Chinese programmers life harder.

we can address that in documentation

Use Unzoned, we do not need documentation at all.

@mattjohnsonpint
Copy link
Collaborator

@hax - I assume your argument applies to documentation and discussion of the concept - not to the keyword itself. I know of no cases where a compiler understands translated names of language keywords.

@mattjohnsonpint
Copy link
Collaborator

FWIW, at the TC39 committee meeting last week, we did not particularly debate naming because it's not critical for Stage 2 - but it will be for Stage 3. I did not personally find that anyone there seemed to have a problem with "Civil" naming that we currently are using.

I plan to write up a matrix describing the different options, pros and cons, prior usage, and other items that have been brought up on this thread and elsewhere. That should help us come to a final decision.

@jodastephen
Copy link

Reading the comments on various threads, it is clear that "civil" has been interpreted in two distinct ways by people:

  • to imply the local time-line, as opposed to the zoned time-line (ie. an absence of time-zone)
  • to imply the common/gregorian/ISO date-time system

The result was a suggestion to have ZonedCivilDateTime (based on the second interpretation of "civil").

I think both are perfectly reasonable approaches to a naming scheme in theory - they just focus on different aspects of the date/time concept - absence of time-zone information vs which calendar system is being used. So why do I favour the former?

The first reason is that absence of time-zone information on some classes is the most important aspect when initially learning the API, and later when communicating with colleagues (Ubiquitous language). In particular, because so many other date/time APIs operate "on the cheap" with a single all-in-one class, it can require a little bit of re-educating to see why less information (no time-zone) is actually more useful. Learning that they do not have a time-zone is enough for most people, who have no particular need to dig deeper. But the philosophy behind it is that they sit on the local time-line - a time-line that is not anchored to a specific instant. Most people never need to consider this, but as API authors it is important to have a coherent underlying structure and philosophy that the API builds on and exposes.

The second reason is that the calendar system really isn't that important a piece of information. Now I know this is heresy for some, but the harsh reality is that the Gregorian calendar dominates the globe. To avoid some of the contentious aspects of this, I generally refer to the calendar as the ISO-8601 calendar system (which is proleptic Gregorian). Other calendar systems can be built on top of an ISO base, either as wrappers or localization.

Naming the set of classes after something that an unquestioned fact for most of users (the calendar system) isn't the best option IMO. Instead they should be named after the concept that really distinguishes them from the other classes, which is which time-line is it on (aka, the presence or absence of the time-zone).

As a final point, a key test for any naming approach is how to name the methods withZoneSameLocal() and withZoneSameInstant(). With the "local" naming approach, the method names drop out without difficulty. I haven't seen any other naming approach that can do that. (For those wondering, withZoneSameLocal() takes a ZonedDateTime and changes the time-zone, trying its best to keep the LocalDate and LocalTime the same, whereas withZoneSameInstant() keeps the same instant).

In summary, JSR-310 chose local time-line vs zoned time-line as the primary axis of the API, and thus got Local vs Zoned. And the result was the creation of a ubiquitous language that developers could use and express the concepts they needed to express. I simply don't think Civil implies the time-line aspect clearly enough.

@jodastephen
Copy link

I've just read the current spec and essentially you've ended up with 80% of JSR-310 but chosen a different name for the key concept. Given the Local name has been in IS0-8601, Java and elsewhere for 20 years now this just smacks of not-invented-here. I think this is going to cause nothing but annoyance and confusion to generations of developers.

I also note that the spec does not include withZoneSameLocal() and only has withZoneSameInstant() (named withZone(), which is imprecise when there are two choices). As such, you've removed a key piece of functionality where the naming issue becomes apparent. The result will be a poorer method name when the missing functionality gets added at some point in the future.

I won't repeat the explanations for the Local prefix again - readers can see them up-thread. I do think the "cons" in civil.md are pretty dubious - the first one misundrestands the local time-line concept of ISO-8601 and the second one doesn't make any sense. I also note the many expressions of support for my comments on Local above and on previous threads from the wider community which seem to have been ignored.

@ryzokuken
Copy link
Member

@jodastephen interesting. Could you please make a PR against civil.md documenting your thoughts so everyone could see more clearly what was missing and perhaps move forward and make a better choice?

@jorroll
Copy link

jorroll commented Jul 12, 2019

@jodastephen after initially agreeing with your comment, I found #79 to be an informative read on why local isn't an appropriate name for an internet standard. I'm not familiar with JSR-310, but I have seen Local used in other programming languages so I can understand your sentiment. I think an important difference is that, for most programming languages, it's acceptable for them to reflect the conventions of the country they are invented in. Java was invented in America, it has American conventions. In a server environment, you are free to choose another language if you don't like Java's conventions. Javascript (and internet centric technology in general) is a global language (though obviously one written in English). People are forced to use Javascript if they want to target a web browser. Because of this, I agree with the decision to create a new convention for the global environment.

My current concern, after looking through various issues here, is that I have the impression that none of the champions for this proposal have much experience with non-Gregorian calendars. More to the point, I get the impression that everyone involved has an American/European background. I'm American myself (and have no experience with other Calendaring systems), but it seems like this proposal needs to cultivate the involvement of people actually living with other calendar systems. Even acknowledging that version 1.0 of this spec will only target a Gregorian-esq calendar (which is understandable), it seems like a lot of research needs to be done to understand how it will be extended in the future.

The statement in the README that "other calendar systems are out-of-scope for this proposal" seems rather ridiculous. I have a hard time believing that you can "fix Date" while ignoring one of it's major flaws. Would love to be told I'm wrong though, and that there is a solid understanding of how this will be extended to support other calendars.

PS: I can imagine someone countering by saying that Java is used around the world. I'll preempt that hypothetical comment by saying that that would be missing the point. Yes you can use Java anywhere in the world, but you don't have to.

@ryzokuken
Copy link
Member

@thefliik some great points here, that said, about the whole multiple calendars thing, I am still quite unsure. While I agree that it’s one of the major flaws of Date, I believe ECMA-402 was created to fix all issues like this, and this proposal (targeted to ECMA 262) should focus on the issues that do not fall under the jurisdiction of Intl.

FWIW, people are exploring the possible interactions between the different objects in this proposal and the different Intl objects like DateTimeFormat. I think that bridge is what holds the key to solving that issue.

P.S. While I grew up in an increasingly English-centric environment, I have had some experience with the Saka Calendar (https://en.wikipedia.org/wiki/Indian_national_calendar) and am in regular contact with people who follow that calendar much more closely, so I volunteer to help address any concerns with relation to how this could possibly work in a different calendar system.

@kaizhu256
Copy link
Contributor

volunteer to help address any concerns with relation to how this could possibly work in a different calendar system.

if i wanted to integrate Saka-calendar with javascript, the cost-effective solution is to expose 3 static-functions that manipulate isostrings:

function getGregorianFromSaka(isostringSaka) {...}
function getGregorianToSaka(isostringGregorian) {...}
function getSakaAdd(isostringSaka, durationObj) {...}
var date;

/*
 * example to add 1 saka-month to gregorian-date "2020-01-15"
 */
date = "2020-01-15";
date = getGregorianToSaka(date);       // saka "1941-10-25"
date = getSakaAdd(date, { month: 1 }); // saka "1941-11-25"
date = getGregorianFromSaka(date);     // greg "2020-02-14"

its cost-effective because it requires zero-coordination with this proposal or tc39. this same design-pattern can be applied to other calendar-systems (e.g. lunar).

@ljharb
Copy link
Member

ljharb commented Jul 14, 2019

If you believe that’s the best solution, then are you planning to publish a library that does it, and persuade everyone who’s currently convinced they need a builtin solution that your library is sufficient?

@kaizhu256
Copy link
Contributor

i did propose it as an alternative in issue #53. at the time, the 5 proposed static-functions did everything the 5 classes CivilDate, CivilDateTime, CivilTime, Instant, and ZonedInstant (at the time) did. with far less spec-work.

@ljharb
Copy link
Member

ljharb commented Jul 14, 2019

The quantity of spec work isn’t really important, though - shipping the best solution for the most use cases is. Static functions that manipulate strings are certainly sufficient for some use cases, but are wildly insufficient for many others - so that suggests it wouldn’t be a good fit.

@ryzokuken
Copy link
Member

@ljharb @kaizhu256 while a bunch of 3rd party libs like these would be useful and would “just work:tm:”, I guess it’ll still be useful to add functionality to get the ISO string in an alternate calendar system in the spec itself, but I do agree that it makes sense to address that in a separate, later proposal, perhaps to ECMA 402 since I’m personally a huge critic to scope creep. But I’d love your feedback.

@jodastephen
Copy link

@thefliik and others - I note the crossover between issues of naming and issues of calendar systems again. (For those not aware, I'm the author of Joda-Time and JSR-310 (java.time.*) which have been influential in the design space for dates/times for 20 years)

Firstly, it is certainly true that the Gregorian/ISO calendar system is the de facto world standard, and pushed into greater importance by the internet. It is vital to be able to format/parse a localized date, but this is a localization issue, not a class design one.

Why is it a localization issue? Well, when you go to a website and buy access to a service for a month, the length of the month isn't determined by what calendar system the user likes to see dates in. If it were, the user might only get 5 days of access to the service (Coptic calendar has 12 thirty day months followed by a 5 or 6 day month). As such, it is always the case that business logic must be written against a single fixed calendar system, and again that is almost universally going to be the Gregorian/ISO one.

As such, the "date without time-zone" object exists primarily to represent just the concept of a date, not the date in any particular calendar system. Thus, the "date without time-zone" object could be satisfied by a count of days from an epoch. However, since there is one dominant calendar system in the world, and it is much more convenient for humans to deal with year/month/day than epoch-days, the best representation is actually the Gregorian/ISO one.

Given all this, it is wrong to name the "date without time-zone" after the calendar system. Because, the use of Gregorian/ISO is very much a secondary concern. Ultimately, the naming point that actually matters is the "without time-zone" part. And ISO-8601 used the term "local time" here over 20 years ago.

TLDR: The pure way to model a date is a count of "days from 1970" with years/months/days being entirely about localization, but for pragmatic/practical reasons it is more useful to the vast majority of users to define the class using years/months/days in the Gregorian/ISO calendar. The naming of a common prefix for classes without time-zone is a completely separate problem.

@hax
Copy link
Member

hax commented Jul 15, 2019

@ryzokuken civil.md document only cover the prefixes "civil", "local" and "gregorian", but not mention all other options in this issue and comments: "unzoned", "plain", "floating", "simple", "basic", "naive"... I hope we remember the lesson of "globalThis" and give a full documentations for all possible names and ask the community for feedback, before too late.


Especially "unzoned". Search the whole thread and you will find most support it. The only disagreement was coming from @jodastephen: "Unzoned" is negative. But when explaining the concept, we include Stephen always use "date without time-zone", so the concept is essentially "negative". Programmers can not really understand the concept without time-zone. Personally I don't see any aspect that "civil" is superior to "unzoned".

@ryzokuken
Copy link
Member

@hax I understand where you’re coming from, and realize that you might be disappointed with the current state of civil.md. Could you please make a PR to civil.md documenting your thoughts around the unzoned prefix, possibly even the other options that you think have not received appropriate attention? AFAIK, ignoring certain alternatives was never the intent.

Thank you. Also, I’m reopening this issue since there’s obviously something actionable in here. Let’s close this once we have reached a final prefix that works for most if not all parties.

@ryzokuken ryzokuken reopened this Jul 15, 2019
@kpdonn
Copy link

kpdonn commented Jul 27, 2019

Throwing in my opinion as a random person who is eagerly awaiting proposal-temporal: It'd be ideal to just go with "Local" because that's the common terminology that already exists for the concept.

I agree that "Local" initially seems like the exact opposite of what it represents. I have mostly managed to convince myself that it kind of makes sense when I squint and think of it as abstractly referring to a local date for any/every arbitrary location. But if I was naming the concept fresh, I'd vote for "Plain" or one of the other options before "Local".

But "Local" is the prefix that already exists, and it doesn't cause any real problems despite arguably being oddly named. You learn it once and then it's too useful and too simple to forget. And many developers have already learned it thanks to the success of the joda-time, java.time and other libraries based on them. "Local" is well known enough that if Javascript ends up using "Civil", the documentation should have prominent notes clarifying that a "CivilDate" is the exact same thing as a "LocalDate" in other languages.

Think of it this way: If Javascript goes with "Local", that will likely become what future languages choose without much debate because the familiarity of "Local" will be overwhelming at that point(it's a relatively rare programmer who is unfamiliar with both Java and Javascript). If Javascript goes with "Civil", suddenly it's the wild west and every new library will be forced to debate if it should join team "Local" or "Civil"(where it will inevitably be decided that both are terrible and "Gregorian" is the one true prefix).

Is "Civil" really enough of an improvement over "Local" to make it worth being different?

@sffc
Copy link
Collaborator

sffc commented Jul 28, 2019

I am concerned that the word "Local" is too similar to "Locale" as in i18n. We will have methods like toLocaleString, for example, which could be confusion if the types also have the word "Local" in them. I would rather stay away from any variant of this word meaning anything other than i18n in the JavaScript standard.

Also, FYI, JavaScript is not the first language to use "Civil"; C++ Abseil (#139) beat us to it.

@rxaviers
Copy link
Member

With respect to the Gregorian / non-Gregorian calendar comments, I suggest they are discussed in their own thread: #31.

@hax
Copy link
Member

hax commented Jul 30, 2019

@ryzokuken Not sure how PR should be -- I can add some pros/cons about unzoned, but current civil.md already have the conclusion.

@ryzokuken
Copy link
Member

@hax and a PR would be a great place to discuss the new prefix and if it makes more/less sense than the current choice.

@gajus
Copy link

gajus commented Sep 3, 2019

Prefix it with "Hard", i.e. HardDate, HardTime, HardDateTime.

Just because dates are hard.

@zimmi
Copy link

zimmi commented Sep 17, 2019

Another way to think about Local types is that they are adequate for applications with a local (as opposed to global) userbase. JavaScript is ubiquitous, this mnemonic seems sensible for "native" applications.

@pipobscure
Copy link
Collaborator

This has been solved. We’re nit prefixing, but namespacing in the Temporal global.

@hax
Copy link
Member

hax commented Sep 30, 2019

@pipobscure Hope the proposal repo could be updated soon. 😃

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests