-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
help wantedExtra attention is neededExtra attention is needed
Description
Task: Use built-in JavaScript functions to calculate the date. As this is just a refactor of the code, it should perform just as with day.js. Changing the structure is fine, although the structure can remain as is. Here is the unfinished snippet I have:
const vscode = require('vscode');
const dayjs = require('dayjs');
const { yourXmas } = vscode.workspace.getConfiguration('xmasTime');
// Helpers
/**
* @param {string} targetDate
* @returns {{ ms: number, days: number, hours: number, minutes: number}}
*/
function getDifference(targetDate) {
// ...
return {
ms: diffMs,
days: diffDays,
hours: diffHours,
minutes: diffMinutes,
};
}
function getUnit(difference) {
// ...
}
// Get the time left and return the text
function getTimeLeft() {
// ...
}
module.exports = { getTimeLeft };Metadata
Metadata
Assignees
Labels
help wantedExtra attention is neededExtra attention is needed