Open benloh opened 1 month ago
The two key concerns are:
1: We want consistent input across users for easier reading (e.g., if one kid writes 8/14 and one writes Aug, 14 it's hard to see them as the same)
2: We want filters to allow: before, after, and maybe "between" (and by extension, sort up or down)
So, that makes me think that dates will be ideal, rather than try and layer that on top of strings?
Everything I come up with to not have all 3 formats is a hack like "have the time, set it to 12:00, but don't display it." Which makes me think that you are right about needing all 3.
I glanced at the gephi documentation online and they seem to use date, datetime and then if you want time on its own you use number. I'm guessing it's not a major time savings (no pun intended) so we might as well be robust if you are doing the work anyhow?
@benloh I just confirmed this with Kalani. One minor addition / thought: for Historians, it is apparently REALLY annoying to use a calendar selection tool for cases where they may not have a specific detail (e.g., might know a year and not the date). Therefore, I think the easiest compromise on user interface would be to have a drop-down / text field for each component where there is an option for not setting one. So:
For export purposes, let's use UTC.
Actually, from this perspective, we only need one date type, and all of the options could be set to unspecified, but if we don't need them we may not want them appearing in the choices. That is, if we want kids to add only a year, we can store it as being YYYY0000 etc., but we wouldn't want to show the kids anything beyond the year box. So it might be that one date format is all we need, but that we want some display / choice options?
@jdanish Alright. I think if you want to do this, we need to go all in. This is complicated from an internal data representation perspective, and a flexible UI perspective, as well as template definition perspective, not to mention filtering and sorting.
There are whole libraries dedicated to this, but I think we'll have to roll our own version to capture all the nuances.
I'm guessing it's probably about 2 to 3 weeks of calendar time to implement this.
OK. I think it's worth it. Does that throw off our budget / timeline? I don't have a sense of how 2-3 weeks fits or not.
[!CAUTION] Working notes. Please ignore
Review date frameworks
A flexible date format tha allows for:
1921
4/1921
apr 1921
4000 bce
chrono
will interpret the value and preview the result for you. This way you get feedback about what the interpretation is. Ideally the interpretation allows for non-specified values, e.g. 4/1921
will be interpreted as April 1921, NOT April 1, 1921....
or view as...
menu. e.g. entering 4/1921
will show
4/1921 (as entered)
4/1921 (DATE_SHORT)
Apr 1921 (DATE_MED)
April 1921 (DATE_FULL)
...
The format is sensitive to the values that have and have NOT been specified. e.g. since "DAY" is not specified, the selected format will now unnecessarily interpet an implied day of "1". This menu might get rather long.
We can also use historical era notation, e.g. jun 1921 bce
will be interpreted as:
jun 1921 bce (as entered)
6/1921 BCE (HISTORICAL_DATE_SHORT)
Jun 1921 BCE (HISTORICAL_DATE_MED)
June 1921 BCE (HISTORICAL_DATE_LONG)
...
We only add the historical date as an option here because bce
was entered in the text input field.
See this codepen chrono demo to get a feel for how it interprets dates. Note that I believe we can have chrono deliberately ignore implied dates (e.g. 4/1921
does not have to be interpreted as 4/1/1921
)
BCE dates for filtering/sorting can be supported by using negative dates.
HistoricalDateTimeClass
Setters
setEra
setYear
Internally, the HistoricalDateTime representation is a class with 8 properties (listed above), any of which may be undefined
.
HistoricalDateTimeVObject
In addition to being able to select any of the internal data fields individually, combinations are also useful:
See temporal for inspiration and language.
Support luxon
outputs? e.g.
Since the data representation is internal, you can easily select different formats for the ouptut, e.g. change from DATE_SHORT to DATE_MED without changing the data.
Selecting a date
before <date>
after <date>
around <date>
between <date1> and <date2>
@jdanish @kalanicraig In working through the historical dates, I have a few questions about how those dates are used.
I'm assuming that most historical dates (e.g. dates that require an eras designation) would follow these rules (from [BC and AD, BCE and CE: What’s the Difference?](https://www.antidote.info/en/blog/reports/bc-and-ad-bce-and-ce-whats-difference#:~:text=CE%20stands%20for%20%E2%80%9Ccommon%20(or,at%20least%20the%20early%201700s.)
BC should appear after the numerical year, while AD should appear before it.
1100 BC, AD 1066
BCE and CE should both appear after the numerical year.
1100 BCE, 1066 CE
As is the case with most initialisms, periods may be used after each letter.
1100 B.C., A.D. 1066, 1100 B.C.E., 1066 C.E.
A few questions:
Mar 1100 BC
Mar 2 1100 BC
Mar 2 1100 B.C.
2 Mar 1100 BC
Mar AD 1100
AD Mar 1100
Mar 2 AD 1100
AD Mar 2 1100
2 Mar AD 1100
AD 2 Mar AD 1100
Any other common formats that we need to support?
Dates are complex, and it just programmatically
Let's assume the historical need is driving the software first. With that assumption in mind, we'll want to accommodate a variety of historic dates, which means ISO and Gregorian but also Islamic, Jewish, Chinese, etc. However: almost all dating systems have a year, month, day.
What I'd suggest is that rather than trying to validate every date type and display every date type, we:
Does that make sense?
—k
On Wed, Jun 12, 2024 at 2:17 PM benloh @.***> wrote:
@jdanish https://github.com/jdanish @kalanicraig https://github.com/kalanicraig In working through the historical dates, I have a few questions about how those dates are used.
I'm assuming that most historical dates (e.g. dates that require an eras designation) would follow these rules (from [BC and AD, BCE and CE: What’s the Difference?]( https://www.antidote.info/en/blog/reports/bc-and-ad-bce-and-ce-whats-difference#:~:text=CE%20stands%20for%20%E2%80%9Ccommon%20(or,at%20least%20the%20early%201700s.)
-
BC should appear after the numerical year, while AD should appear before it. 1100 BC, AD 1066
BCE and CE should both appear after the numerical year. 1100 BCE, 1066 CE
As is the case with most initialisms, periods may be used after each letter. 1100 B.C., A.D. 1066, 1100 B.C.E., 1066 C.E.
A few questions:
- Other than BCE/CE and BC/AD, are there other eras designations that we need to support?
- Is it important to follow the "AD" comes before the year, but "BC" after the year formatting?
- Are months or days ever included? And if so, what format would the be? e.g. would you ever use:
Mar 1100 BC Mar 2 1100 BC Mar 2 1100 B.C. 2 Mar 1100 BC Mar AD 1100 AD Mar 1100 Mar 2 AD 1100 AD Mar 2 1100 2 Mar AD 1100 AD 2 Mar AD 1100
Any other common formats that we need to support?
— Reply to this email directly, view it on GitHub https://github.com/netcreateorg/netcreate-itest/issues/207#issuecomment-2163644906, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACKL4NF47WGJID3P2KZGM5TZHCGCPAVCNFSM6AAAAABHZNKF6SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRTGY2DIOJQGY . You are receiving this because you were mentioned.Message ID: @.***>
We actually have a nifty library called chronos
that can let us input times in a variety of formats and then have the system interpret and validate the date as a date object, and then display that date in a variety of formats. For example:
apr 1
month:4 day:1
04/01
or April 1
or any number of different options.Similarly:
10000 bc
year:10000
10,000 B.C.E
or 10000 BC
etc.And it can potentially fall back to an interpreted date, e.g.
Around 10000 bc
year:10000
, ignoring the 'Around' text10,000 B.C.E
or 10000 BC
etc.You can then decide whether you want the date display in the node to use the date as entered, or as some specific formatted string (defined in the project template), or perhaps even a flexible value that you can select dynamically.
Advantages:
24
is day or a year.It does make choosing dates require a little extra work.
But I might be overthinking this and a simple date field that has separate five dimensions is more appropriate?
I don’t mind the extra work to edit the template if Kalani thinks it’d be helpful for historians…. For kids I could see arguments both ways. Is it a major difference in effort required?
I lean toward the library that lets us actually do date sorting without choosing a dominant system. For instance the standard Islamic calendar doesn’t have a BC.
On Wed, Jun 12, 2024 at 6:04 PM Joshua Danish @.***> wrote:
I don’t mind the extra work to edit the template if Kalani thinks it’d be helpful for historians…. For kids I could see arguments both ways. Is it a major difference in effort required?
— Reply to this email directly, view it on GitHub https://github.com/netcreateorg/netcreate-itest/issues/207#issuecomment-2163977085, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACKL4NDB645CFP5HJISXWTLZHDAWDAVCNFSM6AAAAABHZNKF6SVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNRTHE3TOMBYGU . You are receiving this because you were mentioned.Message ID: @.***>
Partly implemented. See #228
When defining a custom attribute type you have the option of three types:
There is no built-in support for Dates. So if you define a custom attribute date field, e.g. "Date of Birth" or "Date or Printing" etc, you need to use a string. And any filtering options or table sorting options will be string based.
Using a number does not work because the input fields use validation and only allow numbers, e.g. you can't enter "4/2/24".
Do we need to add support for a native date field? Time also?
This starts to get complicated. e.g. sometimes you want only date, sometimes only time, and sometimes you want date-time. So if we were going to do this, we probably would need three types of fields.
Or we can keep things simple and make sure templates use "strings"?