forked from penguin86/luna-tracker
Compare commits
14 Commits
8e4a5b89c0
...
bottle_tim
| Author | SHA1 | Date | |
|---|---|---|---|
| 4f0416e1c1 | |||
| 8c2fcaaef5 | |||
| 01907d7c4e | |||
| 3a3dc2faf4 | |||
| 2518118759 | |||
| d8b67531db | |||
| 0a424e8807 | |||
| 8adacd3bfe | |||
| 508c14ff6e | |||
| 7d67a2e33b | |||
| a0dc023941 | |||
| 6759956461 | |||
| c521a3373f | |||
| 1ad5f31b32 |
@@ -455,7 +455,7 @@ class MainActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
fun isValidTime(timeSeconds: Long, durationSeconds: Int): Boolean {
|
fun isValidTime(timeSeconds: Long, durationSeconds: Int): Boolean {
|
||||||
val now = System.currentTimeMillis() / 1000
|
val now = System.currentTimeMillis() / 1000
|
||||||
return (timeSeconds + durationSeconds) <= now && durationSeconds < (12 * 60 * 60)
|
return (timeSeconds + durationSeconds) <= now && durationSeconds < (24 * 60 * 60)
|
||||||
}
|
}
|
||||||
|
|
||||||
val onDateChange = { time: Long ->
|
val onDateChange = { time: Long ->
|
||||||
@@ -499,7 +499,6 @@ class MainActivity : AppCompatActivity() {
|
|||||||
|
|
||||||
d.setPositiveButton(android.R.string.ok) { dialogInterface, i ->
|
d.setPositiveButton(android.R.string.ok) { dialogInterface, i ->
|
||||||
val time = pickedDateTime.time.time / 1000
|
val time = pickedDateTime.time.time / 1000
|
||||||
|
|
||||||
if (isValidTime(time, duration)) {
|
if (isValidTime(time, duration)) {
|
||||||
event.time = time
|
event.time = time
|
||||||
event.quantity = duration
|
event.quantity = duration
|
||||||
|
|||||||
Reference in New Issue
Block a user