lightningrodlabs / rea-playspace

Holochain app to play with REA accounting
32 stars 7 forks source link

Bug: Event list needs to use event date #167

Closed fosterlynn closed 1 year ago

fosterlynn commented 2 years ago

... instead of create date. We'll need to do a bit of logic to get one event date per event...

adaburrows commented 1 year ago

This is related to #41, where we need to create a taxonomy for dates. Should I assume that it should be XOR between hasPointInTime and hasBeginning?

fosterlynn commented 1 year ago

Should I assume that it should be XOR between hasPointInTime and hasBeginning?

Sure, it's as good as anything right now. Or maybe safer to not assume XOR, just take hasPointInTime, else hasBeginning, else hasEnd? Just for reporting.

adaburrows commented 1 year ago

Logic I'm thinking about using:

const times = [e.hasPointInTime, e.hasBeginning, e.hasEnd, e.created];
const orderingTime = times.find((t) => t && t != '' && t != null);

It returns the first value that actually exists.

fosterlynn commented 1 year ago

Looks good to me!