Comments (5)
Could you paste the short format that you're trying to render?
from i18n-js.
does not work to on google chrom
var date = new Date();
I18n.strftime(date, "%d/%m/%Y");
"Wed Feb 08 2012 16:17:33 GMT+0200 (EET)"
from i18n-js.
Are you populating the I18n.translations object? This is a requirement, so it can retrieve the proper name for months and weekdays. Try running something like this:
I18n.translations = {
en: {
date: {
abbr_day_names: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
day_names: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
abbr_month_names: [null, "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],
month_names: [null, "January", "February", "March", "May", "June", "July", "August", "September", "October", "November", "December"]
}
}
};
var date = new Date();
console.log(I18n.strftime(date, "%d/%m/%Y"));
console.log(I18n.strftime(date, "%b %d %Y"));
from i18n-js.
No further comments, so I supposed you just figured it out! ;)
from i18n-js.
I have the same issue. I wonder, are there any template translation files for different languages?
from i18n-js.
Related Issues (20)
- Feature Request: Add ability to export JS files HOT 1
- Feature Request: Have the I18nJS.listen call be lazy
- Migration guide does not discuss backends HOT 2
- Bug: HOT 1
- Bug: I18n.t is not a function & I18n is not defined HOT 1
- Bug: multiple locales dir in listen configuration require to specify full path, not relative
- Feature Request:
- Bug: scope and options should be read-only HOT 7
- Bug: `proc` rules should be cleared from exported JSON localization files HOT 1
- Bug: deep sorting for keys missed HOT 2
- Feature Request: Mechanism to specify explicit order of plugins HOT 2
- Bug: overwriting identical exported JSON localization files HOT 2
- Bug: Unable to resolve make-plural HOT 2
- Bug: i18n lint fails when using plugins HOT 3
- Bug: Lint Translations ignoring app config and translations config HOT 3
- Get currently used translation HOT 1
- Feature Request: Support `esmodule` HOT 1
- Bug: SyntaxError: Unexpected token 'export' HOT 4
- Bug: While trying to resolve module `make-plural` HOT 1
- Bug: i18n-js is not compatible with Vite HOT 2
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 i18n-js.