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

Moment creation defaults to current date #912

Merged

Conversation

ichernev
Copy link
Contributor

This has been requested a few times:

  • if the format contains an year, do not default anything
  • if there is no year but month, then default to current year
  • if there is day of month, default to current year and month

@sherwinyu
Copy link

Any update on this?

@ichernev
Copy link
Contributor Author

It was just posted :) I hoped that @timrwood can have a look, but any comments will be appreciated. I hope it'd be merged in the next release.

@@ -743,6 +758,19 @@
config._d = date;
}

function currentDateArray(config) {
var now = new Date();
if (config._isUTC) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ichernev added a commit that referenced this pull request Jul 27, 2013
…ent-date

Moment creation defaults to current date
@ichernev ichernev merged commit 7883f25 into moment:develop Jul 27, 2013
@ichernev ichernev deleted the feature/create-defaults-to-current-date branch July 27, 2013 07:30
@timrwood
Copy link
Member

Looks good to me.

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

Successfully merging this pull request may close these issues.

None yet

3 participants