split out dateUtils on the backend

This commit is contained in:
azivner
2018-04-02 20:46:46 -04:00
parent 277368ab43
commit 6ab0cea4e3
24 changed files with 90 additions and 111 deletions

View File

@@ -3,7 +3,7 @@
const sql = require('./sql');
const noteService = require('./notes');
const labelService = require('./labels');
const utils = require('./utils');
const dateUtils = require('./date_utils');
const CALENDAR_ROOT_LABEL = 'calendar_root';
const YEAR_LABEL = 'year_note';
@@ -80,7 +80,7 @@ async function getMonthNoteId(dateTimeStr, rootNoteId) {
monthNoteId = await getNoteStartingWith(yearNoteId, monthNumber);
if (!monthNoteId) {
const dateObj = utils.parseDate(dateTimeStr);
const dateObj = dateUtils.parseDate(dateTimeStr);
const noteTitle = monthNumber + " - " + MONTHS[dateObj.getMonth()];
@@ -109,7 +109,7 @@ async function getDateNoteId(dateTimeStr, rootNoteId = null) {
dateNoteId = await getNoteStartingWith(monthNoteId, dayNumber);
if (!dateNoteId) {
const dateObj = utils.parseDate(dateTimeStr);
const dateObj = dateUtils.parseDate(dateTimeStr);
const noteTitle = dayNumber + " - " + DAYS[dateObj.getDay()];