]> git.ipfire.org Git - thirdparty/moment.git/commitdiff
[misc] fix lint issues (#5762)
authorKunal Marwaha <marwahaha@berkeley.edu>
Mon, 26 Oct 2020 20:03:50 +0000 (13:03 -0700)
committerGitHub <noreply@github.com>
Mon, 26 Oct 2020 20:03:50 +0000 (13:03 -0700)
src/locale/sr-cyrl.js
src/locale/sr.js

index 2c26999a04b34b45d11e9204ab3dfae8c85f3bce..780b31c2335605fa0486453ff26b70d134e5d313 100644 (file)
@@ -21,30 +21,31 @@ var translator = {
         yy: ['годину', 'године', 'година'],
     },
     correctGrammaticalCase: function (number, wordKey) {
-        if (number % 10 >= 1 && number % 10 <= 4 && (number % 100 < 10 || number % 100 >= 20)) {
-            return number % 10 === 1 ? wordKey[0] : wordKey[1]
+        if (
+            number % 10 >= 1 &&
+            number % 10 <= 4 &&
+            (number % 100 < 10 || number % 100 >= 20)
+        ) {
+            return number % 10 === 1 ? wordKey[0] : wordKey[1];
         }
-        return wordKey[2]
+        return wordKey[2];
     },
     translate: function (number, withoutSuffix, key, isFuture) {
         var wordKey = translator.words[key];
 
         if (key.length === 1) {
             // Nominativ
-            if (key === 'y' && withoutSuffix) return 'једна година'
+            if (key === 'y' && withoutSuffix) return 'једна година';
             return isFuture || withoutSuffix ? wordKey[0] : wordKey[1];
         }
 
-        const word = translator.correctGrammaticalCase(number, wordKey)
+        const word = translator.correctGrammaticalCase(number, wordKey);
         // Nominativ
-        if (
-            key === 'yy' &&
-            withoutSuffix &&
-            word === 'годину') {
-                    return (number + ' година')
+        if (key === 'yy' && withoutSuffix && word === 'годину') {
+            return number + ' година';
         }
 
-        return (number + ' ' + word);
+        return number + ' ' + word;
     },
 };
 
index 7e38deab5ff5abccbfbb1254e37b20ea6abf2709..792fb33fb8b4cb06373aebcccad014c428517e2f 100644 (file)
@@ -1,4 +1,3 @@
-import { without } from 'lodash';
 //! moment.js locale configuration
 //! locale : Serbian [sr]
 //! author : Milan Janačković<milanjanackovic@gmail.com> : https://github.com/milan-j
@@ -22,30 +21,31 @@ var translator = {
         yy: ['godinu', 'godine', 'godina'],
     },
     correctGrammaticalCase: function (number, wordKey) {
-        if (number % 10 >= 1 && number % 10 <= 4 && (number % 100 < 10 || number % 100 >= 20)) {
-            return number % 10 === 1 ? wordKey[0] : wordKey[1]
+        if (
+            number % 10 >= 1 &&
+            number % 10 <= 4 &&
+            (number % 100 < 10 || number % 100 >= 20)
+        ) {
+            return number % 10 === 1 ? wordKey[0] : wordKey[1];
         }
-        return wordKey[2]
+        return wordKey[2];
     },
     translate: function (number, withoutSuffix, key, isFuture) {
         var wordKey = translator.words[key];
 
         if (key.length === 1) {
             // Nominativ
-            if (key === 'y' && withoutSuffix) return 'jedna godina'
+            if (key === 'y' && withoutSuffix) return 'jedna godina';
             return isFuture || withoutSuffix ? wordKey[0] : wordKey[1];
         }
 
-        const word = translator.correctGrammaticalCase(number, wordKey)
+        const word = translator.correctGrammaticalCase(number, wordKey);
         // Nominativ
-        if (
-            key === 'yy' &&
-            withoutSuffix &&
-            word === 'godinu') {
-                    return (number + ' godina')
+        if (key === 'yy' && withoutSuffix && word === 'godinu') {
+            return number + ' godina';
         }
 
-        return (number + ' ' + word);
+        return number + ' ' + word;
     },
 };