Skip to content

moment.weekday() alternative function #559

Closed
@oliv9286

Description

@oliv9286

I'm trying to migrate from moment to dayJS and currently there is no alternative for moement.weekday(). As far as I understand it is a locale aware version of day() which already exists in dayjs.

gitter convo with maintainer:

Olivia Zhang @oliv9286 Mar 28 13:49
hello ^^ are there any alternatives for moement/weekday? https://momentjs.com/docs/#/get-set/weekday/

iamkun @iamkun Mar 28 19:50
@oliv9286 No at this time. But we are happy to support this by creating a new plugin. Can you provide some real use case of this API, please?

Olivia Zhang @oliv9286 Mar 29 10:11
@iamkun to be honest I don't have a direct use for it myself, it's more about migrating to moment to dayjs. Moment is massive and cannot be tree shaken. For the code that's in my project, I can replace moment and use alternative dayjs functions. But my project also uses a 3rd party dep -- react-dates which is dependent on moment, and they use this weekday function, the migration becomes tricky because moment and dayjs's APIs don't fully match (airbnb/react-dates#1294). As far as I understand it just does what day() does but is locale aware. Do you have any recommendations on migration strategies from moment to dayjs?

iamkun @iamkun Mar 30 02:16
Oh I see, you may could open an issue detailing this problem, and we will do it right away.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions