From f1efa4ef216797c10d802c43c1db272323cfefab Mon Sep 17 00:00:00 2001 From: Vikas Rathod Date: Thu, 5 Mar 2020 16:49:42 +0530 Subject: [PATCH 1/3] build: update gradle version --- .idea/codeStyles/Project.xml | 122 ----------------------- .idea/gradle.xml | 19 ---- build.gradle | 2 +- gradle/wrapper/gradle-wrapper.properties | 4 +- 4 files changed, 3 insertions(+), 144 deletions(-) delete mode 100644 .idea/codeStyles/Project.xml delete mode 100644 .idea/gradle.xml diff --git a/.idea/codeStyles/Project.xml b/.idea/codeStyles/Project.xml deleted file mode 100644 index cb22ebb..0000000 --- a/.idea/codeStyles/Project.xml +++ /dev/null @@ -1,122 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/.idea/gradle.xml b/.idea/gradle.xml deleted file mode 100644 index 0d7b25e..0000000 --- a/.idea/gradle.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - \ No newline at end of file diff --git a/build.gradle b/build.gradle index 3c2a8f4..d79d272 100644 --- a/build.gradle +++ b/build.gradle @@ -8,7 +8,7 @@ buildscript { } dependencies { - classpath 'com.android.tools.build:gradle:3.4.1' + classpath 'com.android.tools.build:gradle:3.6.1' classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index c29c248..49ce0da 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Mon Jul 08 22:50:01 EEST 2019 +#Thu Mar 05 15:59:31 IST 2020 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-5.1.1-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip From 1b9597452dcdd22480627edbdcd8bac3dc38a372 Mon Sep 17 00:00:00 2001 From: Vikas Rathod Date: Thu, 5 Mar 2020 16:52:31 +0530 Subject: [PATCH 2/3] chore: update gitignore --- .gitignore | 41 ++++++++++++++++++++++++++++++++--------- 1 file changed, 32 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 2b75303..1060283 100644 --- a/.gitignore +++ b/.gitignore @@ -1,13 +1,36 @@ -*.iml -.gradle /local.properties -/.idea/caches -/.idea/libraries -/.idea/modules.xml -/.idea/workspace.xml -/.idea/navEditor.xml -/.idea/assetWizardSettings.xml -.DS_Store +.cxx + +# Built application files +/*/build/ /build + +# Local configuration file (sdk path, etc) +local.properties + +# Gradle generated files +.gradle/ + +# OS-specific files +.DS_Store +.DS_Store? +._* +.Spotlight-V100 +.Trashes +ehthumbs.db +Thumbs.db + +# User-specific configurations +*.iml +/.idea/* /captures .externalNativeBuild + +# Built application files +*.apk +*.ap_ + +commitlint.config.js +node_modules/ +package-lock.json +package.json \ No newline at end of file From 11eb5a536fbd3eeebc19fcb26eb2600e3b5f6849 Mon Sep 17 00:00:00 2001 From: Vikas Rathod Date: Thu, 5 Mar 2020 16:54:54 +0530 Subject: [PATCH 3/3] fix: leap year validation --- .../main/java/com/msa/dateedittext/DateEditText.kt | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/dateedittext/src/main/java/com/msa/dateedittext/DateEditText.kt b/dateedittext/src/main/java/com/msa/dateedittext/DateEditText.kt index 7fb2c6d..edc3afa 100644 --- a/dateedittext/src/main/java/com/msa/dateedittext/DateEditText.kt +++ b/dateedittext/src/main/java/com/msa/dateedittext/DateEditText.kt @@ -350,7 +350,7 @@ class DateEditText : TextInputEditText { } } //not Leap year - if (year % 100 != 0 || year % 400 != 0) { + if (isLeapYear(year).not()) { val month = mValue.substring(3, 5).toInt() val day = mValue.substring(0, 2).toInt() if (month == 2 && day >= 28) { @@ -365,6 +365,16 @@ class DateEditText : TextInputEditText { return mValue } + private fun isLeapYear(year: Int) = when { + year % 4 == 0 -> { + when { + year % 100 == 0 -> year % 400 == 0 + else -> true + } + } + else -> false + } + /** * validate user text input for MMyy Date Format * @param value: String (user text input)