AvailableName
AvailableName

Reputation: 706

Angular2 Invalid language tag: en_US

I would like to display a date format based on a different locale. Ideally one that I can decide upon after a query to a remote server. (The value to be put in the date field is retrieved in this same query).
I'm trying to use this answer but am getting an error: Invalid language tag: en_US

code:

@NgModule({...
  providers: [
{provide: LOCALE_ID, useValue: "en_US"}
],
...

I'm obviously missing some kind of resource, but I have no idea what.

Upvotes: 1

Views: 2956

Answers (1)

fez
fez

Reputation: 665

In the question you linked it has:"en-US"

However you have:"en_US"

Upvotes: 4

Related Questions