Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: improve return type of getFirstDay() #784

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

st3iny
Copy link

@st3iny st3iny commented Jul 22, 2024

Nice to have after nextcloud/server#46592

Signed-off-by: Richard Steinmetz <richard@steinmetz.cloud>
@st3iny st3iny added documentation Improvements or additions to documentation 3. to review labels Jul 22, 2024
@st3iny st3iny requested a review from susnux July 22, 2024 13:53
@st3iny st3iny self-assigned this Jul 22, 2024
@st3iny
Copy link
Author

st3iny commented Jul 22, 2024

 lib/date.ts:21:2 - error TS2322: Type 'number' is not assignable to type '0 | 2 | 1 | 3 | 4 | 5 | 6'.

21  return window.firstDay

I guess I have to adjust our typings library as well 🙃

Or would you accept a as any or as (0 | 1 | 2 | 3 | 4 | 5 | 6) workaround?

@susnux
Copy link
Contributor

susnux commented Jul 22, 2024

I guess I have to adjust our typings library as well 🙃

Please do so :)

Or would you accept a as any or as (0 | 1 | 2 | 3 | 4 | 5 | 6) workaround?

In addition to the typings change, yes please use as (0 | 1 | 2 | 3 | 4 | 5 | 6) :)

@susnux
Copy link
Contributor

susnux commented Jul 22, 2024

You can also just define a type alias like
type WeekDay = 0 | 1 | ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants