From f1e38febcd4987b279dbfdb959d3f8ad2b48405c Mon Sep 17 00:00:00 2001 From: Michael Beyeler Date: Wed, 7 Feb 2018 14:22:44 -0800 Subject: [PATCH] rename sdf to simpleDateFormat, formatted --- .../com/simplemobiletools/draw/dialogs/SaveImageDialog.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/kotlin/com/simplemobiletools/draw/dialogs/SaveImageDialog.kt b/app/src/main/kotlin/com/simplemobiletools/draw/dialogs/SaveImageDialog.kt index bfc3f0e..06ba6db 100644 --- a/app/src/main/kotlin/com/simplemobiletools/draw/dialogs/SaveImageDialog.kt +++ b/app/src/main/kotlin/com/simplemobiletools/draw/dialogs/SaveImageDialog.kt @@ -107,9 +107,9 @@ class SaveImageDialog(val activity: SimpleActivity, val suggestedExtension: Stri } private fun getInitialFilename(): String { - // Display date and time in human readable format: - val sdf = SimpleDateFormat("yyyy-MM-dd_HH-mm") - val defaultFilename = "image_${sdf.format(Date(System.currentTimeMillis()))}" + val simpleDateFormat = SimpleDateFormat("yyyy-MM-dd_HH-mm") + val formatted = simpleDateFormat.format(Date(System.currentTimeMillis())) + val defaultFilename = "image_${formatted}" return if (curPath.isEmpty()) defaultFilename else curPath.getFilenameFromPath().substring(0, curPath.getFilenameFromPath().lastIndexOf(".")) }