Test for date parts
See original GitHub issueIs your feature request related to a problem? Please describe. Several styles call for different date formatting depending on whether a date is year-only or has various more specific parts.
Describe the solution you’d like
CSLm has a solution by adding three condition attributes for if
that test how specific a date variable is (see here):
has-year-only
has-to-month-or-season
(has month or season, but no day)has-day
I think we should adopt these attributes.
Additional context Replaces https://github.com/citation-style-language/schema/issues/32#issuecomment-644727755
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:17 (17 by maintainers)
Top Results From Across the Web
Test for time part existence in DATE data type - Stack Overflow
You can just test against your DATE column whatever you want about Time part. For example, to test if the column is at...
Read more >SQL Server DATEPART() Function - W3Schools
The DATEPART() function returns a specified part of a date. This function returns the result as an integer value. Syntax. DATEPART(interval, date). Parameter ......
Read more >Date Functions - Tableau Help
Returns the number of date parts (weeks, years, etc) between two dates. Syntax, DATEDIFF(date_part, date1, date2, [start_of_week]). Output, Integer. Definition ...
Read more >Tableau dates - date functions and date formats - TAR Solutions
The complete guide to dates in Tableau. Learn about Tableau date functions - datetrunc, datepart, dateadd, datename, datediff, dateparse and ...
Read more >ISDATE function - Google Docs Editors Help
The ISDATE function returns whether a value is a date. Parts of an ISDATE function ISDATE(value) Part.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Okay, let’s go with:
has-day
missing-day
year-only
Two issues. First, how do you specify which date variable is being tested? Second, it makes for awkward tests I think because the test is usually for what’s missing, so it would have be to have
match="none"
, which would make it hard to combine with other conditions.That’s
date-precision="year" match="none"