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

createdAt and updatedAt #248

Open
wellermiranda opened this issue Jan 16, 2015 · 1 comment
Open

createdAt and updatedAt #248

wellermiranda opened this issue Jan 16, 2015 · 1 comment

Comments

@wellermiranda
Copy link

How can I change this properties names? I'm trying to use the same database that I use in a cakephp application and cakephp use "created" and "modified"...

@jancimertel
Copy link

As far as i know, createdAt and updatedAt are system properties which are based on flag, that can be changed with 'model.config.useTimestamps = false'.

After that, you should use your own defined properties in model
this.defineProperties({
created: {type: 'datetime'}
});

Since you are using cakephp, the actual time could be set in one of the hooks, check
https://github.com/geddy/model#lifecycle-events.

Hope this helps even though its a few months old question.

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