Skip to content

Commit

Permalink
add dateString and dateLong method
Browse files Browse the repository at this point in the history
  • Loading branch information
limxing committed Jan 27, 2021
1 parent 0a40077 commit f63d247
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions datepicker/src/main/java/top/leefeng/datepicker/DatePickerView.kt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,16 @@ class DatePickerView @JvmOverloads constructor(

var drawListener: PickerView.DrawListener? = null

val dateString: String
get() {
return "${result[0]}-${result[1]}-${result[2]}"
}

val dateLong: Long?
get() {
return sdf.parse(dateString)?.time
}

private val scroolListener = object : RecyclerView.OnScrollListener() {
private var lastTag: Any = 0
private var lastValue = ""
Expand Down

0 comments on commit f63d247

Please sign in to comment.