Comments (9)
Changing "eras" property like following made it work fine:
{ "name": "平成", "start": new Date("1989/1/8").getTime(), "offset": 1988 },
{ "name": "昭和", "start": new Date("1926/12/25").getTime(), "offset": 1925 },
{ "name": "大正", "start": new Date("1912/7/30").getTime(), "offset": 1911 },
{ "name": "明治", "start": new Date("1968/9/8").getTime(), "offset": 1867 }
from globalize.
seems to work, thanks!
from globalize.
A different fix is needed as this one is not compatible with the specification for eras. See jquery.global.js lines 429-435
eras: [
// eras in reverse chronological order.
// name: the name of the era in this culture (e.g. A.D., C.E.)
// start: when the era starts in ticks (gregorian, gmt), null if it is the earliest supported era.
// offset: offset in years from gregorian calendar
{ "name": "A.D.", "start": null, "offset": 0 }
],
from globalize.
Also, see http://www.i18nguy.com/l10n/emperor-date.html the start of 明治 is 1868/9/8 not 1968/9/8
from globalize.
Thank you for the indications.
from globalize.
Here's correct values:
{ "name": "平成", "start": new Date("1989/1/8").getTime(), "offset": 1988 },
{ "name": "昭和", "start": new Date("1926/12/25").getTime(), "offset": 1925 },
{ "name": "大正", "start": new Date("1912/7/30").getTime(), "offset": 1911 },
{ "name": "明治", "start": new Date("1868/9/8").getTime(), "offset": 1867 },
{ "name": "西暦 '", "start": null, "offset": 0 }
from globalize.
Thanks for your help. Next step is a QUnit test (see /tests/ folder) that fails with the current values and passes with the new values. There should be at least one test for each era.
from globalize.
Thank you again for instruction.
But testing format and parse date part (test/parse.js lines 43-49) is not complete...
from globalize.
Globalize 1.x doesn't support Japanese calendar (regression). If you need such support, please weigh in #320. I'm closing this issue in favor of #320 to help focus our efforts. Also, note the new implementation is going to use CLDR data and potentially new code as well.
from globalize.
Related Issues (20)
- api.globalizejs.com status? HOT 1
- `"short"` date skeleton parses single-digit years HOT 1
- Unit Formatter Returning Internal Error with CLDR v40.0.0 HOT 5
- Force positive sign HOT 1
- Unit formatting megabyte in Polish short form failed because [email protected] has inconsistent data HOT 1
- Cannot get timezone names or the abbreviations from globalizer
- unitFormatter throw exception for locale "pl" with cldr-data 35 HOT 3
- Extend number format to use string instead of number HOT 4
- skeleton: "Bhm" is not supported HOT 1
- parseDate sets the time forward by an hour for non DST date time HOT 2
- Potential security issue HOT 1
- index.html
- Percent format and parsing HOT 2
- Module not found: Error: Cannot resolve module 'cldr' - in cypress tests
- Active development status check ???? HOT 1
- new Func() in globalize dist folder HOT 1
- important! How to convert date to custom format?
- Globalize date formatter prints quotes around string literals when using short formats
- Globalize date formatter prints quotes around string literals when using short formats
- Make the constructor case-insensitive HOT 1
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 globalize.