package jackall.moncalc.viewmodel import android.databinding.ObservableField import android.text.format.DateFormat import jackall.moncalc.vo.HistoryItem /** * Created by matsumoto_k on 2017/11/03. */ class HistoryItemViewModel { val templeName = ObservableField<String>() val fruitName = ObservableField<String>() val gradeName = ObservableField<String>() val createAt = ObservableField<String>() fun loadItem(item: HistoryItem) { templeName.set(item.templeName) fruitName.set(item.fruitName) gradeName.set(item.gradeName) createAt.set(DateFormat.format("yyyy/MM/dd kk:mm:ss", item.createAt).toString()) } }