Comments (7)
I think this is fixed now
from vue-moment.
I think this issue would be solved by PR #37
from vue-moment.
ok, so I think the ordering of the imports of the locales is important as it uses the last import as the default locale. If I want 'en-gb' as my default, but an option to use 'fr', I order my imports like this...
import 'moment/locale/fr'
import 'moment/locale/en-gb'
This is the code I have put in my mounted method
mounted() {
console.log(this.$moment.locale())
this.$moment.locale('fr')
console.log(this.$moment.locale())
this.$moment.locale('en-gb')
console.log(this.$moment.locale())
},
Which outputs...
en-gb
fr
en-gb
Which is what I believe we are after?
from vue-moment.
nuxt
1
import 'moment/locale/th'
2
moment(date) {
// moment.locale('th');
var strdate = moment("th").format("LLLL");
var strdate = moment(date).add(543, "years");
return moment(strdate).format("Do MMMM YYYY hh:mm");
},
from vue-moment.
Hi @nioc,
We have now merged in PR #37, I believe this refactor will fix your issue.
// app.vue
<script>
methods: {
setLanguage (lang) {
console.log(lang)
this.$moment.locale(lang)
console.log(this.$moment.locale())
}
}
}
</script>
from vue-moment.
Hello, great news. I'll try it tonight or tomorrow. Stay tuned :)
from vue-moment.
I'm sorry but I think PR does not fix my issue 😢
I launched npm update
, checked my package.json seems correct : "vue-moment": "^2.1.0"
I also tried to change the value en
to en-gb
, still do not change...
from vue-moment.
Related Issues (20)
- Vulnerability in the moment module before 2.19.3 HOT 7
- Where can I add 'moment.suppressDeprecationWarnings = true'? HOT 1
- Cannot redefine property: $moment HOT 1
- vue moment not working when used in axios HOT 1
- "ReferenceError: moment is not defined" HOT 11
- Getting unrecognized time in 24hr format. HOT 5
- ./node_modules/moment/src/lib/locale/locales.js Critical dependency: the request of a dependency is an expression
- ./node_modules/moment/src/lib/locale/locales.js 78:12-82:13 Critical dependency: the request of a dependency is an expression HOT 1
- Deprecation warning: value provided is not in a recognized RFC2822 or ISO format. HOT 1
- How to get timezone of client?
- Reduce bundle size? HOT 1
- Filters being deprecated in Vue 3 HOT 6
- moment-timezone does not work for tz Pacific/Auckland with vue-moment HOT 2
- Deprecation warning: use moment.updateLocale(localeName, config) to change an existing locale
- Compatibility issues with vue 3 HOT 2
- Example for using within string interpolation in Vue template HOT 2
- Deprecation warning - value provided is not in a recognized RFC2822 or ISO format
- Use 1 month/day ago etc instead of a month/day ago.
- Moment.js <2.29.2 vulnerabilities
- Abandoned repo ?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vue-moment.