(key, values)
| 16569 | // no arguments are passed in, it will simply return the current global |
| 16570 | // locale key. |
| 16571 | function getSetGlobalLocale (key, values) { |
| 16572 | var data; |
| 16573 | if (key) { |
| 16574 | if (isUndefined(values)) { |
| 16575 | data = getLocale(key); |
| 16576 | } |
| 16577 | else { |
| 16578 | data = defineLocale(key, values); |
| 16579 | } |
| 16580 | |
| 16581 | if (data) { |
| 16582 | // moment.duration._locale = moment._locale = data; |
| 16583 | globalLocale = data; |
| 16584 | } |
| 16585 | else { |
| 16586 | if ((typeof console !== 'undefined') && console.warn) { |
| 16587 | //warn user if arguments are passed but the locale could not be set |
| 16588 | console.warn('Locale ' + key + ' not found. Did you forget to load it?'); |
| 16589 | } |
| 16590 | } |
| 16591 | } |
| 16592 | |
| 16593 | return globalLocale._abbr; |
| 16594 | } |
| 16595 | |
| 16596 | function defineLocale (name, config) { |
| 16597 | if (config !== null) { |
no test coverage detected