package com.zj365.health.fragment

import com.xty.common.Dateutils
import com.xty.common.TimeUtils.getWeekTime
import com.zj365.health.vm.SleepVm

class SleepStatisticWeekFrag  : BaseSleepStatisticFrag<SleepVm>() {
    init {
        type = SleepEnum.WEEK.type
        defaultDate = getWeekTime()
    }
     override fun getData(date: String, isDemonstrate: Boolean) {
         date.let {
             val split = it.split("至")
             val start = split.get(0)
             val end = split.get(1)
             mViewModel.getSleepStatistic(id, SleepEnum.WEEK.type, start, end, isDemonstrate )

         }
     }


    override fun getXLable(date: String): String {
        return Dateutils.yearToMonth(date)
    }

    override fun getBarWidth(): Float {
        return 0.3f
    }
 }