The following information is automatically extracted from the JS code files. Methods and variables that begin with the double underscore ("__") are considered to be part of the private API of the library.
function lookupDayCode(dcstr)
This is the main way to create DayCodes.
The input argument is an ISO formatted string of the form YYYY-MM-DD, such as 2021-01-10
This method returns an immutable DayCode object from the internal pool.
function haveDayCodeForString(dcstr)
True if we have a day code for the given string
This can be used as a form of primitive date format checking
DayCode.prototype.getDateString = function()
Returns the ISO date string of the DayCode objects, eg 2020-09-10
DayCode.prototype.isBefore = function(other)
True if THIS DayCode object is before the argument DayCode
DayCode.prototype.isAfter = function(other)
True if THIS DayCode object is AFTER the argument DayCode
DayCode.prototype.dayAfter = function()
Return the day after the given object.
DayCode.prototype.dayBefore = function()
Day before the given object.
DayCode.prototype.nDaysBefore = function(nd)
N Days Before this DayCode
DayCode.prototype.nDaysAfter = function(nd)
N days after this DayCode
DayCode.prototype.daysUntil = function(dc)
Number of days from this DayCode to the argument DayCode
DayCode.prototype.getShortDayOfWeek = function()
Short Day of Week for this DayCode (Mon, Tue, ... Sat, Sun)
DayCode.prototype.getDayOfWeek = function()
Day of week for this day code.
DayCode.prototype.getMonthName = function()
Name of month for this DayCode.
DayCode.prototype.getNiceDisplay = function()
Get a "Nice" display for the DayCode, in the form:
Mon, 09-10
Thu, 10-01
These are a bit more palatable for dropdowns.
function getTodayCode()
DayCode for current Date.
function getNDaysAgo(n)
N days before today.
function padLeadingZeros(str2pad, reqlen)
Utility function for padding zeros on string, needed for date formatting.
function getEarliestOkayDate()
The earlist date that can be expressed by the DayCode system.
As of October 2020, the system can represent all dates ranging from
2013-10-03 to 2041-02-17.
For dates falling outside of this range, you need to do your own
date processing.
function getDayCodeList()
Complete list of all day codes in the system.
In order, starting with earliest date.
function getDayCodeMap()
return map of ISO date code to DayCode object.
function getCurrentWeekList()
List of dates corresponding to the current week.
function getWeekOfList(mondaycode)
Get the list of date strings corresponding to the week of the given Monday.
The Monday will be the first day of the list.
Argument is a DayCode
function getMonday4Date(dc)
Return the DayCode that correspond to the Monday that starts the
week that includes the given DayCode.
function getLastMonday()
Most recent Monday - the starting Monday for today's date.
See getMonday4Date method above
function ExactMoment(longmilli)
Construct an exact Moment using the given millisecond argument.
This is the number of milliseconds since the Unix epoch.
https://en.wikipedia.org/wiki/Unix_time
function exactMomentNow()
Create an Exact Moment representing the current instant of time.
This is one of the main ways to create an ExactMoment.