SamAmco / track-and-graph

An android app for tracking personal data and creating custom graphs
GNU General Public License v3.0
438 stars 40 forks source link

Add timestamp DataType #172

Closed hberntsen closed 2 years ago

hberntsen commented 2 years ago

This adds a timestamp datatype that can be used for tracking just timestamps, i.e. to track when you go to sleep or eat. This would fix #104 and #134.

This type saves the time part of the datapoint as seconds from 0:00 in the data point, similar to the duration type.

Some TODOs:

I'm new to this codebase / Kotlin / Android development so I wonder whether the approach I took has a chance to get merged :slightly_smiling_face:.

SamAmco commented 2 years ago

Hi. I'm sorry but i have to decline this at this time. If the intention is for the value of the data point to represent the time since 00:00 that day, then the data type is time duration. Also every data point has a timestamp already so there is redundancy here.

I want to keep the data types to a bear minimum because the next major phase of development is functions. Every function written will need to know how to process every data type so more data types means exponentially more complexity. It's worth noting though that you could use a function to do something like this. "Copy the time since 00:00 that day to the value field" is a valid function that takes any data type as an input and outputs data with a time duration data type.

Thanks for drawing my attention to those two issues though i should go back and address those further with your point that the time of day can be thought of as a time duration.

hberntsen commented 2 years ago

Thank you for your response! Makes sense :slightly_smiling_face: