Info.weekdays seems to be mutable
See original GitHub issueDescribe the bug
It seems that Info.weekdays
is mutable and it affects DateTime
instances.
To Reproduce
To reproduce, I just called .pop()
on Info.weekdays
in the console on your website:
https://moment.github.io/luxon/docs/class/src/datetime.js~DateTime.html
Here’s a screenshot of the console:
Actual vs Expected behavior
Luxon claims to be immutable. My expectation is that running Info.weekdays('short')
would give me a new copy of the array instead of a global constant that is used by DateTime
instances.
Desktop (please complete the following information):
- macOS
- Chrome 86
- luxon v1.25.0
Additional context
The reason I am doing this is because I’m trying to get a copy of Info.weekdays('short')
but with Sunday being at the beginning of the array.
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Understand What is Mutable and Immutable in Python
#tuples are immutable, so you cannot add new elements, hence, using merge of tuples with the # + operator to add a new...
Read more >python - Spark: Is a col of a datetime on a weekday or weekend?
I'm writing Spark code in Python. I have a col(execution_date) that is a timestamp. How would I turn that into a column that...
Read more >2.4 Mutable Data - Composing Programs
By bundling behavior and information together, this Python object offers us a convincing, self-contained abstraction of a date. Dates are objects, but numbers, ......
Read more >Python calendar module: prmonth() method - w3resource
Python calendar module: The prmonth() method is used to print a month's calendar. See also prmonth() method example.
Read more >A simple PHP API extension for DateTime. - Carbon
$mutable = Carbon::now(); $immutable = CarbonImmutable::now(); ... To get some interesting info about languages (such as complete ISO name or native name, ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks, @icambron. I’ll put together a PR.
Closed by #829