-
Notifications
You must be signed in to change notification settings - Fork 121
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
UNIX Timestamp #33
Comments
If anyone has the same issue, then you can use this function in your
|
I just ran into this same issue and did some digging and found a nice simple fix. As you mentioned, Vue component filters: {
formatUnix: function (value) {
if (value) {
return moment.unix(value).format('MM-DD-YYYY')
}
}
} Usage in template - no parenthesis required
This will take Unix epoch (timestamp) as input and give you back |
I install vue-moment in my vue appliction and created the filter but this returns: [Vue warn]: Error in render function: "ReferenceError: moment is not defined"
found in
---> <App> at src/components/App.vue
<Root> |
@Joeper214 install moment for the filter not vue-moment. npm install --save moment |
Unix epoch support added in #58— will close this when it's merged in. |
I can't find a way to make it work with UNIX timestamps. Is it possible or did you cut off this feature?
Moment.js states you can do
moment.unix(value).format("MM/DD/YYYY")
but how can I do this with your filter?The text was updated successfully, but these errors were encountered: