cenotaph
Sorry trex, we can't handle your insurance claim
Just having fun with Elixir and seeing this method.
thinking would months in a year ever change.. but then seeing the error playing around ![]()
iex(1)> Calendar.ISO.months_in_year(1)
12
iex(2)> Calendar.ISO.months_in_year(99)
12
iex(3)> Calendar.ISO.months_in_year(3939848447)
** (FunctionClauseError) no function clause matching in Calendar.ISO.months_in_year/1
The following arguments were given to Calendar.ISO.months_in_year/1:
# 1
3939848447
Attempted function clauses (showing 1 out of 1):
def months_in_year(year) when is_integer(year) and (year >= -9999 and year <= 9999)
(elixir 1.11.3) lib/calendar/iso.ex:601: Calendar.ISO.months_in_year/1
Most Liked
NobbZ
This is as sepcified in ISO 8601. Extended years with more than 4 digits are not mandatory and require prior agreement with sender and receiver of the date.
In theory implementing an own Calendar.ExtendedISO which supports years with more than 4 digits should be possible and would fullfil the “prior agreement” part.
3
al2o3cr
TBH, tracking anything with exact date-stamps prior to the twentieth century is a bit of a minefield - the calendar in ISO8601 started being adopted in 1583 but took a looooooooong time (and a lot of politics / religion played out with swords and muskets) to be consistently adopted:
1
Popular in Chit Chat
Just having fun with Elixir and seeing this method.
:thinking: thinking would months in a year ever change.. but then seeing the error p...
New
Hello everyone,
I’m currently reading Elixir in Action (3rd Edition), and I’d like some advice on how to deepen my understanding of OTP ...
New
Hey everyone! The biggest event of the year for our community is fast approaching—ElixirConf US 2026!
Whether you’ve been writing Elixir...
New
Other popular topics
Elixir plugin for JetBrain’s IntelliJ Platform (including Rubymine)
This is a plugin that adds support for Elixir to JetBrains IntelliJ...
New
As promised, the first release candidate of Phoenix 1.3.0 is out! This release focuses on code generators with improved project structure...
New
When I run the Plug and I recompile I wind up having to use Ctrl C to quit iex and start again. Witht the help of rlwrap I can use the cu...
New
Hey all,
I discovered Elixir and I love it. I always wanted to learn a functional programming and I intended to go for Haskell, but afte...
New
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible.
total = 10
while total != 0
...
New
We’ve put together this wiki for Phoenix LiveView - please feel free to add any info you feel is worth including.
What is Phoenix LiveV...
New
I asked this very same question on twitter and got some interesting feedback, but I thought it would be a good question to ask here as we...
New
Hi everyone,
I was playing with phoenix liveView but I run into an issue. I have a form and want to validate each input text when the te...
New
Good day to you all.
I have been struggling to get a query involving like and ilike to work.
Can anyone assist me on this, please?
pro...
New
Hello guys,
I have finally made it. I created an admin interface for a framework. It’s been on my todo list for years and with the curre...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #advent-of-code
- #elixirconf-us
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #security
- #performance









