Skip to content

Date incorrectly formatted when calendar type is Japanese Emperor Reign #39

@adriank09

Description

@adriank09

From what I understand, this feature might not be properly supported, as shown in #36, but I'll post anyway to raise awareness.
This may be a potential issue for users who use Japanese era in their dates.

Reproduction Steps

// Corresponds to 2021/03/04 in Gregorian calendar
object v = 44259; 
NumberFormat nf = new("[$]ggge\"\"m\"\"d\"\";@");
NumberFormat nf2 = new(@"[$-411]ge\.m\.d;@");
// Prints the output
Console.WriteLine(nf.Format(v, new System.Globalization.CultureInfo("ja-JP")));
Console.WriteLine(nf2.Format(v, new System.Globalization.CultureInfo("ja-JP")));

Expected output

令和3年3月4日
R3.3.4

Actual output

44259
44259

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions