Skip to content

Localized YearWeek #110

Description

@marcospassos

We have a use case where we need a type-safe way of representing a localized week in an application. That object is pretty much the same of YearWeek, except that the first day and the minimal number of days varies.

Is there support for implementing such temporal?

I thought initially to implement a LocalizedYearWeek, with some factory methods such as LocalizedYearWeek.of(int year, int week, WeekDefinition weekDefinition). The class WeekDefinition is merely a value object that defines the first day and the minimal number of days of a week, that can also work as a factory of WeekFields.

Introducing a WeekDefinitionQuery would provide an interoperability layer between week objects, e.g. YearWeek.from(LocalizedYearWeek.of(2018, 1, WeekDefinition.ISO)) or LocalizedYearWeek.from(YearWeek.of(2018, 1)).

I would be happy to provide a PR if welcome.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions