(key, values)
| 2104 | // no arguments are passed in, it will simply return the current global |
| 2105 | // locale key. |
| 2106 | function getSetGlobalLocale(key, values) { |
| 2107 | var data; |
| 2108 | if (key) { |
| 2109 | if (isUndefined(values)) { |
| 2110 | data = getLocale(key); |
| 2111 | } else { |
| 2112 | data = defineLocale(key, values); |
| 2113 | } |
| 2114 | |
| 2115 | if (data) { |
| 2116 | // moment.duration._locale = moment._locale = data; |
| 2117 | globalLocale = data; |
| 2118 | } else { |
| 2119 | if (typeof console !== 'undefined' && console.warn) { |
| 2120 | //warn user if arguments are passed but the locale could not be set |
| 2121 | console.warn( |
| 2122 | 'Locale ' + key + ' not found. Did you forget to load it?' |
| 2123 | ); |
| 2124 | } |
| 2125 | } |
| 2126 | } |
| 2127 | |
| 2128 | return globalLocale._abbr; |
| 2129 | } |
| 2130 | |
| 2131 | function defineLocale(name, config) { |
| 2132 | if (config !== null) { |
no test coverage detected