package com.ytpm.hydtw.adapter

import android.content.Context
import com.ytpm.hydtw.dao.Record
import com.ytpm.hydtw.databinding.AdapterMineBinding
import com.ytpm.hydtw.utils.DateTimeConverter

class MineAdapter(items: MutableList<Record>) :
    BaseAdapter<AdapterMineBinding, Record>(AdapterMineBinding::inflate, items) {
    override fun onBindingData(
        context: Context,
        holder: BaseHolder<AdapterMineBinding>,
        binding: AdapterMineBinding,
        t: Record,
        position: Int
    ) {

        val ddd = DateTimeConverter.convertToBeijingTime(t.answerTime, "yyyy/MM/dd HH:mm:ss")
        val index = itemCount - position
        binding.time.text = "${index}: $ddd"
    }
}