Read the statement by Michael Teeuw here.
Any plan to replace "request" and "moment"?
-
@mmrize i don’t see whats so hard on week of the year.
what day of the week is 1/1, subtract that from 7, and then that is the start of the weekly cycle.
til you run out of days to count.we don’t use it normally, but its still the week of the year. has nothing to do with month. that is a different scheme
my science teacher in high school had a great topic, measurement…
you can measure anything with anything… just record what the tool waswe were required to measure everything in broomstick handles, broomstick #1 in the lab to be precise.
we could subdivide broomstick #1 however we wanted to provide more accuracy, as long as we wrote down the algorithm. (divide by 3, 6, 10?.. , 1000 ml beaker height, whatever)
the last week doesn’t run over into a new year, it ENDS when the year ends.
just so happens that week #1 of the NEXT year is the same logical week, but who cares, as we started counting from 1 again. -
@sdetweil said in Any plan to replace "request" and "moment"?:
what day of the week is 1/1, subtract that from 7, and then that is the start of the weekly cycle.
ISOWeek is easy. Conventional week is the problem.
For example, in the United States, Sunday is the first day of the week. The week with January 1st in it is the first week of the year.
In France, Monday is the first day of the week, and the week with January 4th is the first week of the year. It means January 1st could be the last week of the last year sometimes. And Jan. 10th could be the first week in certain year.
And in other countries, there is also their own rule.
This might be important in some European countries, because they use week number in real life (“my vacation ends 23. Weeks“)
-
@mmrize I care about safari. 😢😢😢
-
@mmrize said in Any plan to replace "request" and "moment"?:
Once (yesterday), I’ve tried to rewrite
clock
module andcalendar
module
withoutmomentjs
or any other3rd party library
, only withDate
andIntl
.The start was not so bad. I could rewrite many features with only
Date
andIntl
.
Where I stuck was theshowWeek
config feature. It has to show the ordinal number of weeks of the year. To calculate ISOweek is not difficult. But in some areas, like the US. they never use the ISO system. damn!. To calculate the conventional US week number, additional pieces of information are needed. (read this.) CurrentIntl
has not yet that feature. I’m waiting forTemporal
and enhancedIntl
releasing.Where I’m getting stuck with Luxon is basic comparision of dates:
Is this time the same or before that time? Moment: m1.isSameOrBefore(m2) (works) Luxon: dt1 <= dt2 (Crashes jsfiddle)
and querying luxon for the locale’s weekday strings is always returning Monday as first, even though it will treat the week correctly otherwise.
luxon.info.weekdays('short') == Mon
-
@mmrize said in Any plan to replace "request" and "moment"?:
@sdetweil said in Any plan to replace "request" and "moment"?:
what day of the week is 1/1, subtract that from 7, and then that is the start of the weekly cycle.
ISOWeek is easy. Conventional week is the problem.
For example, in the United States, Sunday is the first day of the week. The week with January 1st in it is the first week of the year.
In France, Monday is the first day of the week, and the week with January 4th is the first week of the year. It means January 1st could be the last week of the last year sometimes. And Jan. 10th could be the first week in certain year.
And in other countries, there is also their own rule.
This might be important in some European countries, because they use week number in real life (“my vacation ends 23. Weeks“)
Moment handles this automatically. Everyone else, not so much.
-
@bkeyport many do, and you are not alone.
But how many people are running MM in a safari browser?I guess this is the relevant point here :)
-
@0m4r When I’m testing something, I’ll load it up on my local machine, which is a Mac, and yes, I use Safari. :)
-
@bkeyport same for me, even tho I am aware like 99% of MM users are running it out of a raspberry pi with a Chromium browser.
That is the reason I say the main focus could be on Chromium-based browsers rather than others. -
I’m using Brave which is Chrome based without all the tracking and such ;)
-
@cowboysdude technically it is based on Chromium (https://www.chromium.org/).