Skip to content

Commit

Permalink
Use Java 8 Date/Time API in SubscriptionFragment.
Browse files Browse the repository at this point in the history
  • Loading branch information
Isira-Seneviratne committed Jun 26, 2020
1 parent 1223e0d commit c36f058
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import com.xwray.groupie.kotlinandroidextensions.GroupieViewHolder
import icepick.State
import io.reactivex.disposables.CompositeDisposable
import java.io.File
import java.text.SimpleDateFormat
import java.util.Date
import java.time.LocalDateTime
import java.time.format.DateTimeFormatter
import java.util.Locale
import kotlin.math.floor
import kotlin.math.max
Expand Down Expand Up @@ -189,7 +189,8 @@ class SubscriptionFragment : BaseStateFragment<SubscriptionState>() {
}

private fun onExportSelected() {
val date = SimpleDateFormat("yyyyMMddHHmm", Locale.ENGLISH).format(Date())
val date = DateTimeFormatter.ofPattern("yyyyMMddHHmm", Locale.ENGLISH)
.format(LocalDateTime.now())
val exportName = "newpipe_subscriptions_$date.json"
val exportFile = File(Environment.getExternalStorageDirectory(), exportName)

Expand Down

0 comments on commit c36f058

Please sign in to comment.