create months and days with associated english names, closes #37

This commit is contained in:
azivner
2018-02-10 13:53:35 -05:00
parent b3038487f8
commit e970564036
5 changed files with 25 additions and 6 deletions

View File

@@ -47,7 +47,7 @@ function dateStr(date) {
* @param str - needs to be in the ISO 8601 format "YYYY-MM-DDTHH:MM:SS.sssZ" format as outputted by dateStr().
* also is assumed to be GMT time (as indicated by the "Z" at the end), *not* local time
*/
function parseDate(str) {
function parseDateTime(str) {
try {
return new Date(Date.parse(str));
}
@@ -56,6 +56,12 @@ function parseDate(str) {
}
}
function parseDate(str) {
const datePart = str.substr(0, 10);
return parseDateTime(datePart + "T12:00:00.000Z");
}
function toBase64(plainText) {
return Buffer.from(plainText).toString('base64');
}
@@ -117,6 +123,7 @@ module.exports = {
nowDate,
dateStr,
parseDate,
parseDateTime,
newNoteId,
newNoteTreeId,
newnoteRevisionId,