Skip to content

Commit

Permalink
Add info about removed warning (#484)
Browse files Browse the repository at this point in the history
* Update 03-parent-locale.md

This warning was removed in 2.16.0 (moment/moment@a83615a#diff-6d534a0c3c9df392784bdfbc68d046b3)

However, an exception was thrown when using a moment defined with non existent parent. This bug was fixed in PR #4310. This documentation reflects this.

* Update 03-parent-locale.md

* Update 03-parent-locale.md
  • Loading branch information
cmyers authored and marwahaha committed Jan 7, 2018
1 parent 021a996 commit 9c40c74
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions guides/moment/02-warnings/03-parent-locale.md
@@ -1,16 +1,7 @@
---
title: Parent Locale Undefined
---
```
specified parentLocale is not defined yet
```

This warning is displayed when a locale is defined with a specified parent locale that does not exist.
Warning removed since **2.16.0**.

Because 'xyz' is not a locale, the following code will result in this warning:

```javascript
moment.defineLocale('fakeLocale', {parentLocale:'xyz'})
```

To fix this, choose a parent locale that is already defined. If you are defining a locale that will be the parent of another locale, make sure that your locales are defined in order.
A locale can be defined with a parent before the parent itself is defined or loaded. If the parent doesn't exist or can't be lazy loaded when the moment is created, the parent will default to the global locale.

0 comments on commit 9c40c74

Please sign in to comment.