public void configure(DayElement dayElement, Action onClickAction) { this.dayElement = dayElement; this.sleepUnits.text = dayElement.GetSleepCount() + ""; this.date.text = dayElement.GetDate(); this.onClick = onClickAction; this.duration.text = TimeRecordUtility.MiliSecToDuration(dayElement.GetTotalSleepTime()); }
public void configure(Record record, bool interactable) { this.record = record; this.interactable = interactable; transform.Find("Start").GetComponent <Text>().text = TimeRecordUtility.DateTimeToTimeString(record.getStartDateTime()); transform.Find("End").GetComponent <Text>().text = TimeRecordUtility.DateTimeToTimeString(record.getEndDateTime()); transform.Find("Duration").GetComponent <Text>().text = TimeRecordUtility.DurationAsString(record); }
public double GetTotalSleepTime() { double totalSleepTime = 0; foreach (Record record in records) { totalSleepTime += TimeRecordUtility.DurationInMiliSec(record); } return(totalSleepTime); }
public void configure(DayElement dayElement, SleepElement sleepElement, bool interactable) { this.dayElement = dayElement; this.sleepElement = sleepElement; this.interactable = interactable; String count = ""; if (sleepElement.GetRecords().Count > 1) { count = (sleepElement.GetRecords().Count - 1) + ""; } this.sleepUnits.text = count; this.duration.text = TimeRecordUtility.MiliSecToDuration(sleepElement.GetTotalSleepTime()); Record[] array = sleepElement.GetRecords().ToArray(); String startDateTime = TimeRecordUtility.DateTimeToTimeString(array[array.Length - 1].getStartDateTime()); String endDateTime = TimeRecordUtility.DateTimeToTimeString(array[0].getEndDateTime()); this.fromTo.text = startDateTime + " - " + endDateTime; }
private void Update() { GetComponent <Text>().text = TimeRecordUtility.DurationAsString(RecordManager.getActiveTimeRecord()); }
public String GetDate() { return(TimeRecordUtility.DateTimeToDateString(date)); }