Opened 9 years ago
Closed 9 years ago
#815 closed defect (fixed)
date-part for month and day only work in the default formats
| Reported by: | dstillman | Owned by: | codec |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | styles | Version: | |
| Keywords: | Cc: | simon |
Description
Attachments (1)
Change History (7)
comment:1 Changed 9 years ago by codec
comment:2 follow-up: ↓ 3 Changed 9 years ago by dstillman
cite.js isn't my code, but do those ordinal parts need to be localized (Zotero.getString('date.daySuffixes')) or are they just keys?
comment:3 in reply to: ↑ 2 Changed 9 years ago by codec
Replying to dstillman:
cite.js isn't my code, but do those ordinal parts need to be localized (Zotero.getString('date.daySuffixes')) or are they just keys?
I expect they do - I've no idea how complex the ordinal format can get in other languages though - whether you need a full 31 element array or if these is a simpler solution.
Meanwhile the other changes are useful.
comment:4 Changed 9 years ago by dstillman
Well, I suspect date.daySuffixes is wholly inadequate, but for now let's get Zotero.getString('date.daySuffixes'), which will return the locale-specific equivalent of "st, nd, rd, th", split it into four parts, and use those instead of the English strings. From a quick skim of the locales it looks like many of them just use a particular Unicode character for all four, so at least those will work.
comment:5 Changed 9 years ago by codec
OK - the changes seem to be relatively simple - new version about to be added
Produces the following output
YEAR=2007 (07) DAY=1st/1/01 ACCESSED: YEAR=2007 (07) MONTH=October(Oct/9/09) DAY=10th/10/10
comment:6 Changed 9 years ago by simon
- Resolution set to fixed
- Status changed from new to closed
The date-part uses the wrong variable in cite.js to work out when to use the formatting.
It also doesn't support ordinal formats. These should both be fixed by the attached patch.
e.g.,
produces
MONTH=October(October/October/October) DAY=22/22/22