This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* get the date format by using the date as a string. | |
* This Extension function returns date format, if it matches with any format else it will return null | |
*/ | |
fun String.getDateFormat(): String? { | |
val dateFormats = arrayOf( | |
"yyyy-MM-dd'T'HH:mm:ss.SSSXXX", | |
"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", | |
"yyyy-MM-dd'T'HH:mm:ss.SSSZ", | |
"yyyy-MM-dd'T'HH:mm:ss'Z'", |