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

fix setUpdatedAt and setCreatedAt #46

Merged
merged 1 commit into from
Nov 23, 2016
Merged

fix setUpdatedAt and setCreatedAt #46

merged 1 commit into from
Nov 23, 2016

Conversation

alerosa
Copy link
Contributor

@alerosa alerosa commented Nov 23, 2016

The docs for setCreatedAt and setUpdatedAt` says that they "Set the fields to the current date-time" but they set the date when the feathers application bootstraps.

That's because the new Date function is called during the bootstrap and not every time the hook is triggered. To solve that, I've changed the setField method so that now it can accept a function as second argument and it will call it when the hook is actually triggered.

@eddyystop
Copy link
Collaborator

Thanks very much for the catch!

@eddyystop eddyystop merged commit 38f1c15 into feathersjs-ecosystem:master Nov 23, 2016
eddyystop added a commit that referenced this pull request Nov 29, 2016
- #46
- wrote tests to cover this fix
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.

2 participants