question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Info.weekdays seems to be mutable

See original GitHub issue

Describe 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:

Screen Shot 2020-11-05 at 10 59 59 AM

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:closed
  • Created 3 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
UnsungHero97commented, Nov 10, 2020

Thanks, @icambron. I’ll put together a PR.

0reactions
icambroncommented, Mar 2, 2021

Closed by #829

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found