Skip to content

Option for day the week starts on week_of_year  #78

Open
@yardensachs

Description

@yardensachs

As you know,
A week can start either on a Monday or Sunday (maybe even other days).

Python has that feature already done with strftime:

  • %U Sunday as the first day of the week.
  • %W Monday as the first day of the week.
dt = datetime.datetime(2016, 10, 30)

print(dt.strftime("%U"))
 '44'

print(dt.strftime("%W"))
 '43'

Pendulum's week_of_year currently uses datetime's isocalandar (docs "week starts on a Monday and ends on a Sunday").

There needs to be a way to have both Sunday and Monday as an option because its not consistent across software (e.g. MySQL which uses Sunday). and also, why not have it if python supports it.

I would submit a pull request myself, but this is a design problem because its a property and not a function, so no args possible.

What do you think?

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions