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
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 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- xmlns:android
- ^$
-
-
-
-
-
-
-
-
- xmlns:.*
- ^$
-
-
- BY_NAME
-
-
-
-
-
-
- .*:id
- http://schemas.android.com/apk/res/android
-
-
-
-
-
-
-
-
- .*:name
- http://schemas.android.com/apk/res/android
-
-
-
-
-
-
-
-
- name
- ^$
-
-
-
-
-
-
-
-
- style
- ^$
-
-
-
-
-
-
-
-
- .*
- ^$
-
-
- BY_NAME
-
-
-
-
-
-
- .*
- http://schemas.android.com/apk/res/android
-
-
- ANDROID_ATTRIBUTE_ORDER
-
-
-
-
-
-
- .*
- .*
-
-
- BY_NAME
-
-
-
-
-
-
-
-
-
-
\ 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/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)
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