Corrected handling of dateModified & datePublished #624
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix DOCTEAM#1367
This PR contains the following changes:
json-ld-dateModified
andjson-ld-datePublished
intojson-ld-dateModified-and-Published
.Produce only an entry, if dates are valid and if
datePublished < dateModified
Use first
revhistory/revision/date
fordateModified
and lastrevhistory/revision/date
fordatePublished
.santize-date(date)
template date can be any date in the formatYYYY-M
,YYYY-MM
,YYYY-M-D
,YYYY-MM-D
,YYYY-M-DD
, orYYYY-MM-DD
. If the date doesn't conform to any of these formats, an empty string is returned.validate-date(date)
template $date should be in the format ofYYYY-MM-DDTHH:MMZ
, but only theYYYY-MM-DD
is checked. If the date is valid, true() is return, otherwise false()compare-dates(date1, date2)
Compare two dates lexicographically. Return -1 if
date1 < date2
; 0 ifdate1 == date2
; 1 ifdate1 > date2
.In simple words, the stylesheet follows this approach:
<revhistory>
.datePublished < dateModified