]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
Condensing the getLangDefinition function
authorRocky Meza <rocky@fusionbox.com>
Mon, 11 Jun 2012 16:20:00 +0000 (10:20 -0600)
committerRocky Meza <rocky@fusionbox.com>
Mon, 11 Jun 2012 16:20:00 +0000 (10:20 -0600)
moment.js

index c5d0853bcd6f32eb275fdacb64d3b824be37b985..fd04df9fda35fd70ad13d9860d0f697686aa4c00 100644 (file)
--- a/moment.js
+++ b/moment.js
     // will decide the language based on that, or default to the global
     // language.
     function getLangDefinition(m) {
-        var langKey = (typeof m === 'object') && m._lang ||
-                      (typeof m === 'string') && m ||
+        var langKey = (typeof m === 'string') && m ||
+                      m && m._lang ||
                       currentLanguage;
 
         return languages[langKey];