This commit is contained in:
leca 2024-10-20 17:08:03 +03:00
parent 4f1845dd0e
commit 9b9946b280
1 changed files with 0 additions and 33 deletions

View File

@ -104,34 +104,6 @@ class AddProductActivity : AppCompatActivity() {
update()
}
// dateOfProductionSelectButton.setOnClickListener {
// val c = Calendar.getInstance()
// val year = c.get(Calendar.YEAR)
// val month = c.get(Calendar.MONTH)
// val day = c.get(Calendar.DAY_OF_MONTH)
//
// val dpd = DatePickerDialog(this, { _, y, m, d ->
// product!!.dateOfProduction = SimpleDateFormat("dd.MM.yyyy").parse("$d.${m+1}.$y")!!.time / 1000
// update()
// }, year, month, day)
//
// dpd.show()
// }
// expiryDateSelectButton.setOnClickListener {
// val c = Calendar.getInstance()
// val year = c.get(Calendar.YEAR)
// val month = c.get(Calendar.MONTH)
// val day = c.get(Calendar.DAY_OF_MONTH)
//
// val dpd = DatePickerDialog(this, { _, y, m, d ->
// product!!.dateOfExpiry = SimpleDateFormat("dd.MM.yyyy").parse("$d.${m+1}.$y")!!.time / 1000
// update()
// }, year, month, day)
//
// dpd.show()
// }
amountTextEdit.addTextChangedListener {
val text = amountTextEdit.text.toString()
if (text == "") return@addTextChangedListener
@ -185,11 +157,6 @@ class AddProductActivity : AppCompatActivity() {
shelfLifeTextEdit.visibility = View.VISIBLE
}
// val dateOfProductionParsed = SimpleDateFormat("dd.MM.yyyy").format(Date(product!!.dateOfProduction * 1000))
// findViewById<TextView>(R.id.dateOfProductionTextView).text = "${getString(R.string.date_of_production)}: $dateOfProductionParsed"
// val expiryDateParsed = SimpleDateFormat("dd.MM.yyyy").format(Date(product!!.dateOfExpiry * 1000))
// expiryDateTextView.text = "${getString(R.string.expiry_date)}: $expiryDateParsed"
val dateOfProduction = SimpleDateFormat("dd.MM.yyyy").format(product!!.dateOfProduction * 1000).split(".")