Skip to content

Commit 0091d34

Browse files
committed
fix(date): remove console logs
1 parent f527fb2 commit 0091d34

File tree

4 files changed

+17
-9
lines changed

4 files changed

+17
-9
lines changed

changelog.md

+8
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
Changelog for npm and snapcraft
44

5+
## Version 1.2.2
6+
7+
- Removed debug commands
8+
9+
## Version 1.2.1
10+
11+
- Fixed package.json. Added i18n directory to release build.
12+
513
## Version 1.2.0
614

715
- Added possibility to use humanized dates (big thanks to [Aditya Sriram](https://github.com/aditya95sriram) for contributing this feature). Complete list of all commands can be found in the readme.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@perryrh0dan/taskline",
33
"productName": "Taskline",
4-
"version": "1.2.1",
4+
"version": "1.2.2",
55
"description": "Tasks, boards & notes for the command-line habitat",
66
"repository": "https://github.com/perryrh0dan/taskline",
77
"license": "MIT",

snapcraft.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: taskline
2-
version: '1.2.0'
2+
version: '1.2.2'
33
summary: Tasks, boards & notes for the command-line habitat
44
description: |
55
By utilizing a simple and minimal usage syntax, that requires a flat learning curve, Taskline enables you

src/libs/date.ts

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { set, setDay, isPast, addBusinessDays, format as fnsFormat, addDays, addWeeks, addMonths, addYears, startOfDay, startOfWeek, startOfMonth, startOfYear } from 'date-fns';
1+
import { set, setDay, isPast, addBusinessDays, addDays, addWeeks, addMonths, addYears, startOfDay, startOfWeek, startOfMonth, startOfYear } from 'date-fns';
22
import { Localization } from '../localization';
33

44
const dateNames = { // can depend on locale, can be fetched from CONFIG
@@ -29,7 +29,7 @@ const parseHumanDate = function(input: string): Date | undefined {
2929
const case1a: RegExp = new RegExp(`next (${periods.join('|')})`, 'gi');
3030
if (matchArray = case1a.exec(input)) {
3131
// console.log(matchArray);
32-
console.log('case 1a: next <period>');
32+
// console.log('case 1a: next <period>');
3333
const periodIndex: number = periods.indexOf(matchArray[1]);
3434
parsedDate = startFuncs[periodIndex](now, options);
3535
parsedDate = addFuncs[periodIndex](parsedDate, 1);
@@ -42,7 +42,7 @@ const parseHumanDate = function(input: string): Date | undefined {
4242
const case1b: RegExp = new RegExp(`next (${dateNames.weekday})`, 'gi');
4343
if (matchArray = case1b.exec(input)) {
4444
// console.log(matchArray);
45-
console.log('case 1b: next <weekday>');
45+
// console.log('case 1b: next <weekday>');
4646
const weekdayIndex = getWeekdayIndex(matchArray[1]);
4747
parsedDate = startOfWeek(today);
4848
//parsedDate = datefns.addWeeks(parsedDate, 1);
@@ -56,7 +56,7 @@ const parseHumanDate = function(input: string): Date | undefined {
5656
parsedDate = new Date(); // get fresh date and time
5757
if (matchArray = case2.exec(input)) {
5858
// console.log(matchArray);
59-
console.log('case 2: in <x> <period>');
59+
// console.log('case 2: in <x> <period>');
6060
const num: number = parseInt(matchArray[1]);
6161
const periodIndex: number = periods.indexOf(matchArray[2]);
6262
parsedDate = addFuncs[periodIndex](parsedDate, num);
@@ -67,7 +67,7 @@ const parseHumanDate = function(input: string): Date | undefined {
6767
// case 3: today/tonight/tomorrow/weekday
6868
// case 3a: today/tonight/tomorrow
6969
if (input == 'today' || input == 'tomorrow' || input == 'tonight') {
70-
console.log('case 3a: today/tonight/tomorrow');
70+
// console.log('case 3a: today/tonight/tomorrow');
7171
if (input == 'tomorrow') {
7272
parsedDate = addDays(today, 1);
7373
} else if (input == 'tonight') {
@@ -82,7 +82,7 @@ const parseHumanDate = function(input: string): Date | undefined {
8282
const case3b: RegExp = new RegExp(`^\\s*${dateNames.weekday}\\s*$`, 'gi');
8383
if (matchArray = case3b.exec(input)) {
8484
// console.log(matchArray);
85-
console.log('case3b: <weekday>');
85+
// console.log('case3b: <weekday>');
8686
const weekdayIndex: number = getWeekdayIndex(matchArray[0]);
8787
parsedDate = setDay(today, weekdayIndex);
8888
// if past, get day in next week for same weekday
@@ -117,7 +117,7 @@ export const parseDate = function(input: string, format: string): Date {
117117
format = format || 'yyyy-mm-dd HH:MM'; // Default format
118118
let humanDate: Date | undefined = parseHumanDate(input);
119119
if (humanDate) { // successfully parsed as human date
120-
console.log('human date:', fnsFormat(humanDate, 'PPPPp'));
120+
// console.log('human date:', fnsFormat(humanDate, 'PPPPp'));
121121
return humanDate;
122122
}
123123
let parts: Array<number>;

0 commit comments

Comments
 (0)