Skip to content

Commit 079a682

Browse files
committed
Updated Date.format Method,
Updated README.md Signed-off-by: plsankar <plsankar1996@gmail.com>
1 parent 1078563 commit 079a682

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,16 +60,23 @@ toast(stringRes|string)
6060
toast(stringRes|string, LENGTH_SHORT)
6161
```
6262

63-
### TextInputLayout
63+
### TextInputLayout KTX
6464
```kotlin
6565
getValue()
6666
setValue(string)
6767
clear()
6868
```
6969

70-
### View
70+
### View KTX
7171
```kotlin
7272
hide() // visibility gone by default
7373
hide(VISIBLE|GONE) // or specify
7474
show() // visibility visible
75+
```
76+
77+
### Date KTX
78+
```kotlin
79+
format("dd-MM-yyy")
80+
format("dd-MM-yyy", locale)
81+
format(simpleDateFormat)
7582
```

codekit/src/main/java/com/ctrlbytes/codekit/ktx/Date.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@ fun Date.toFormat(simpleDateFormat: SimpleDateFormat): String {
3232
return simpleDateFormat.format(this)
3333
}
3434

35-
fun Date.toFormat(format: String, locale: Locale): String {
35+
fun Date.toFormat(format: String, locale: Locale = Locale.getDefault()): String {
3636
return SimpleDateFormat(format, locale).format(this)
3737
}

0 commit comments

Comments
 (0)