Currently, I am attempting to showcase an array of numbers
const days = [1, 7, 14, 30, 60]
in a more human-readable format using vue-moment
Everything is functioning correctly
{{ days | duration('humanize') }}
// 'a day'
// '7 days'
// '14 days'
// 'a month'
// '2 months'
Dilemma
I would like to have 1 month
instead of a month
Is there a way to achieve this?
I came across this solution, which involves adjusting the vue-moment configuration.
The documentation at https://www.npmjs.com/package/vue-moment mentions that
vue-moment should adhere to any global Moment customizations, including i18n locales. For further information, refer to http://momentjs.com/docs/#/customization/.
You can also provide a customized Moment object with the plugin options. This method is particularly beneficial for addressing the browserify locale issue demonstrated in the documentation http://momentjs.com/docs/#/use-it/browserify/
However, both approaches require me to install moment AND vue-moment merely to create a moment-config-object to pass into vue-moment. Am I overlooking something here?
I'm seeking a way to input {M: '1 month'}
somewhere and call it a day. Is that achievable?
(loading vue-moment with Vue.use(require('vue-moment'))
)