true if the snak has a value
create a unique id for the Snak
the id
this function checks if two snaks are equal
the other snak
true if the snaks are equal
if (snak.equals(other)) {
// do something
}
Static
fromdates only so add all of the date (year, month, day)
the property of the snak in 'P-form'
the year of the date
the month of the date (1-12) so just the normal months
the day of the date (1-31)
the calendarModel for the snak
the timeSnak
const snak = TimeSnak.fromDate('P1619', new Date(), 'http://www.wikidata.org/entity/Q1985727');
Static
fromCreate a TimeSnak from a Date object.
WARNING: JS Date are horrible and you should not use them. Use a library like moment.js instead. when using it normally you should be fine but anything before 1970 will be wrong. also timezones are not supported so you need to use UTC which is conflicts with wikidata that assumes that all dates are in the local timezone
the property of the snak in 'P-form'
the Date object
the calendarModel for the snak
the timeSnak
const snak = TimeSnak.fromDateObject('P1619', new Date(), 'http://www.wikidata.org/entity/Q1985727');
Generated using TypeDoc
class for the TimeSnak
most used property of this type P1619 (date of official opening)