question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Test for date parts

See original GitHub issue

Is 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:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:17 (17 by maintainers)

github_iconTop GitHub Comments

2reactions
bwiernikcommented, Jun 16, 2020

Okay, let’s go with:

  • has-day
  • missing-day
  • year-only

space-separated list: Anything we’re missing with that?

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.

1reaction
bwiernikcommented, Jun 29, 2020

That’s date-precision="year" match="none"

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found