-
Notifications
You must be signed in to change notification settings - Fork 12
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
[QUESTION] Set default format #73
Comments
add this plugin |
just add .format('YYYY') ex: $moment(datetime).format('YYYY') |
You could create a utility function. So instead of calling moment, you call your function which has the correct format. |
Changing |
Wouldn't it be easier if there was a way to pass it through the module options? Because why would I use this module if I could create a plugin to do the same and have more configuration available. It defeats the whole purpose of this module in my opinion. I don't know if this option already exists but here is my plugin example:
import moment from 'moment'
moment.defaultFormat = '[test] DD-MM-YYYY HH:mm'
export default (_, inject) => {
inject('moment', moment)
} <template>
<div>{{ $moment().format() }}</div>
<!-- Returned: test 21-10-2021 14:11 -->
<template> I may create a PR in the future to add an option like this into the config of this module |
I did create a PR to add this feature but I think they've abandoned this package or forgot about it. No response since I submitted it on February 8. 😕 |
So if in my application, I use 90% of the time, DD/MM/YYYY, is there anyway that the default format is that one? Instead of manually formatting each time?
The text was updated successfully, but these errors were encountered: