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

getTodayTime function throws an error #648

Open
RafaQC opened this issue Dec 4, 2019 · 1 comment
Open

getTodayTime function throws an error #648

RafaQC opened this issue Dec 4, 2019 · 1 comment

Comments

@RafaQC
Copy link

RafaQC commented Dec 4, 2019

It seems there is an issue on the function, it chains the function to set the locale with setting the utcOffset while being undefined.

This is the original code:

export function getTodayTime(value) {
  var today = moment();
  today.locale(value.locale()).utcOffset(value.utcOffset());
  return today;
}

The value I'm passing is just a moment object created from ant.design date picker, but for some reason it can't set it.

I fixed it this way, but it seems it is not setting the locale anyways.

export function getTodayTime(value) {
  var today = moment();
  today.locale(value.locale())
  today.utcOffset(value.utcOffset());
  return today;
}
@rafael-buzzni
Copy link

this happens when using react lazy import.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants