Skip to content
This repository was archived by the owner on Apr 14, 2021. It is now read-only.

Commit fb8dfff

Browse files
watildecaridy
authored andcommitted
Support era to resolve date string (#166)
1 parent 08c47f3 commit fb8dfff

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/12.datetimeformat.js

+8-1
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,14 @@ function CreateDateTimeParts(dateTimeFormat, x) {
991991
fv = ''; // ###TODO
992992
break;
993993

994-
// ###TODO: Era
994+
case 'era':
995+
try {
996+
fv = resolveDateString(localeData, ca, 'eras', f, tm['[['+ p +']]']);
997+
} catch (e) {
998+
throw new Error('Could not find era data for locale '+locale);
999+
}
1000+
break;
1001+
9951002
default:
9961003
fv = tm['[['+ p +']]'];
9971004
}

0 commit comments

Comments
 (0)