Skip to content

Commit

Permalink
Added setting to change 1st day of the week. Fixed #671.
Browse files Browse the repository at this point in the history
  • Loading branch information
ransome1 committed Mar 24, 2024
1 parent e102200 commit 340fd37
Show file tree
Hide file tree
Showing 30 changed files with 92 additions and 121 deletions.
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# sleek
![image](https://github.com/ransome1/sleek/assets/11188741/304d2da2-e8bd-4901-9d12-04a0f5426317)

### sleek is an open-source (FOSS) todo manager based on the todo.txt syntax. It's available for Windows, macOS and Linux

sleek is an open-source (FOSS) todo manager based on the todo.txt syntax. Stripped down to only the most necessary features, and with a clean and simple interface, sleek aims to help you focus on getting things done.

All classic todo.txt attributes are supported and enhanced by additional features. Creating todos is straightforward, and tag-based filtering in tandem with highly customisable grouping and smart full-text search allows for rapid information retrieval. Completed todos can be hidden or archived into separate done.txt files. Easy integration with other todo.txt apps is facilitated by continuously scanning todo.txt files for changes.
Expand All @@ -10,8 +12,8 @@ sleek is available for Windows, macOS and Linux, and in several languages. [Scre
### ❤️ Sponsor sleek
Pushing sleek to the Apple and Microsoft app stores creates annual costs. You can help covering these by [sponsoring the project](https://github.com/sponsors/ransome1).

### 👩🏾‍💻 Become a contributer
We're actively inviting passionate contributors skilled in `React`, `TypeScript`, `Electron`, and `Jest/Playwright` to join our collaborative effort. The `develop` branch reflects the most recent progress. Here you'll find our roadmap: https://github.com/users/ransome1/projects/3. For those interested, [we've updated our contribution guidelines](https://github.com/ransome1/sleek/wiki/Contributing-Guidelines).
### 👩🏾‍💻 This project needs your support
sleek's backlog is becoming increasingly populated, yet our capacity remains limited. If you are skilled in `React`, `TypeScript`, `Electron`, or `Jest/Playwright` you can support this project. Here you'll find our backlog: https://github.com/users/ransome1/projects/3. For those interested, [we've updated our contribution guidelines](https://github.com/ransome1/sleek/wiki/Contributing-Guidelines). The `develop` branch reflects the most recent progress.

### Get sleek from Apple Mac App Store
<a href="https://apps.apple.com/us/app/sleek-todo-manager/id1614704209" target="blank"><img src='assets/store_badges/Download_on_the_Mac_App_Store.png' alt='Get sleek from Apple Mac App Store' width='180'/></a>
Expand Down
2 changes: 1 addition & 1 deletion flatpak/com.github.ransome1.sleek.appdata.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<developer_name>Robin Ahle</developer_name>
<content_rating type="oars-1.1"/>
<releases>
<release version="2.0.12" date="2024-03-23"/>
<release version="2.0.13-rc.1" date="2024-03-24"/>
</releases>
<url type="homepage">https://github.com/ransome1/sleek</url>
<url type="contact">https://github.com/ransome1/sleek/issues</url>
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sleek",
"version": "2.0.12",
"version": "2.0.13-rc.1",
"main": "./src/main/main.tsx",
"scripts": {
"build": "concurrently \"yarn run peggy\" \"yarn run build:main\" \"yarn run build:renderer\"",
Expand Down Expand Up @@ -147,7 +147,7 @@
"webpack-merge": "^5.9.0"
},
"build": {
"buildVersion": "41",
"buildVersion": "42",
"asar": true,
"asarUnpack": "**\\*.{node,dll}",
"files": [
Expand Down
2 changes: 1 addition & 1 deletion release/app/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "sleek",
"version": "2.0.12",
"version": "2.0.13-rc.1",
"description": "todo.txt manager for Linux, Windows and MacOS, free and open-source (FOSS)",
"synopsis": "todo.txt manager for Linux, Windows and MacOS, free and open-source (FOSS)",
"keywords": [
Expand Down
2 changes: 1 addition & 1 deletion snap/snapcraft.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: sleek
base: core20
version: "2.0.12"
version: "2.0.13-rc.1"
summary: todo.txt manager for Linux, free and open-source (FOSS)
description: |
sleek is an open-source (FOSS) todo manager based on the todo.txt syntax. Stripped down to only the most necessary features, and with a clean and simple interface, sleek aims to help you focus on getting things done.
Expand Down
3 changes: 3 additions & 0 deletions src/locales/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"settings.zoom": "Přiblížení",
"settings.disableAnimations": "Vypnout animace",
"settings.useHumanFriendlyDates": "Používat lidsky přívětivá data",
"settings.weekStart": "První den týdne",
"settings.0": "Neděle",
"settings.1": "Pondělí",
"drawer.tabs.attributes": "Atributy",
"drawer.tabs.filters": "Filtry",
"drawer.tabs.sorting": "Řazení",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"settings.zoom": "Vergrößerung",
"settings.disableAnimations": "Animationen deaktivieren",
"settings.useHumanFriendlyDates": "Benutze benutzerfreundliche Datumsangaben",
"settings.weekStart": "Erster Tag der Woche",
"settings.0": "Sonntag",
"settings.1": "Montag",
"drawer.tabs.attributes": "Attribute",
"drawer.tabs.filters": "Filter",
"drawer.tabs.sorting": "Sortierung",
Expand Down
89 changes: 0 additions & 89 deletions src/locales/en-gb.json

This file was deleted.

3 changes: 3 additions & 0 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"settings.zoom": "Zoom",
"settings.disableAnimations": "Disable animations",
"settings.useHumanFriendlyDates": "Use human friendly dates",
"settings.weekStart": "First day of the week",
"settings.0": "Sunday",
"settings.1": "Monday",
"drawer.tabs.attributes": "Attributes",
"drawer.tabs.filters": "Filters",
"drawer.tabs.sorting": "Sorting",
Expand Down
4 changes: 4 additions & 0 deletions src/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
"settings.matomo": "Permitir análisis de Matomo",
"settings.zoom": "Zoom",
"settings.disableAnimations": "Desactivar animaciones",
"settings.useHumanFriendlyDates": "Usar fechas amigables para el usuario",
"settings.weekStart": "Primer día de la semana",
"settings.0": "Domingo",
"settings.1": "Lunes",
"drawer.tabs.attributes": "Atributos",
"drawer.tabs.filters": "Filtros",
"drawer.tabs.sorting": "Ordenación",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"settings.zoom": "Zoom",
"settings.disableAnimations": "Désactiver les animations",
"settings.useHumanFriendlyDates": "Utiliser des dates conviviales",
"settings.weekStart": "Premier jour de la semaine",
"settings.0": "Dimanche",
"settings.1": "Lundi",
"drawer.tabs.attributes": "Attributs",
"drawer.tabs.filters": "Filtres",
"drawer.tabs.sorting": "Tri",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/hi.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"settings.zoom": "ज़ूम",
"settings.disableAnimations": "एनिमेशन अक्षम करें",
"settings.useHumanFriendlyDates": "मानव-मित्रता योग्य तिथियाँ उपयोग करें",
"settings.weekStart": "सप्ताह का पहला दिन",
"settings.0": "रविवार",
"settings.1": "सोमवार",
"drawer.tabs.attributes": "गुण",
"drawer.tabs.filters": "फ़िल्टर",
"drawer.tabs.sorting": "क्रमबद्ध करना",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/hu.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"settings.zoom": "Nagyítás",
"settings.disableAnimations": "Animációk kikapcsolása",
"settings.useHumanFriendlyDates": "Használjon emberbarát dátumokat",
"settings.weekStart": "Hét első napja",
"settings.0": "Vasárnap",
"settings.1": "Hétfő",
"drawer.tabs.attributes": "Tulajdonságok",
"drawer.tabs.filters": "Szűrők",
"drawer.tabs.sorting": "Rendezés",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/it.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"settings.zoom": "Zoom",
"settings.disableAnimations": "Disattiva animazioni",
"settings.useHumanFriendlyDates": "Usa date user-friendly",
"settings.weekStart": "Primo giorno della settimana",
"settings.0": "Domenica",
"settings.1": "Lunedì",
"drawer.tabs.attributes": "Attributi",
"drawer.tabs.filters": "Filtri",
"drawer.tabs.sorting": "Ordinamento",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/jp.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"settings.zoom": "ズーム",
"settings.disableAnimations": "アニメーションを無効にする",
"settings.useHumanFriendlyDates": "使いやすい日付を使用する",
"settings.weekStart": "週の初日",
"settings.0": "日曜日",
"settings.1": "月曜日",
"drawer.tabs.attributes": "属性",
"drawer.tabs.filters": "フィルター",
"drawer.tabs.sorting": "ソート",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/ko.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"settings.zoom": "",
"settings.disableAnimations": "애니메이션 비활성화",
"settings.useHumanFriendlyDates": "사용자 친화적인 날짜 사용",
"settings.weekStart": "주의 첫날",
"settings.0": "일요일",
"settings.1": "월요일",
"drawer.tabs.attributes": "속성",
"drawer.tabs.filters": "필터",
"drawer.tabs.sorting": "정렬",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/pl.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"settings.zoom": "Powiększenie",
"settings.disableAnimations": "Wyłącz animacje",
"settings.useHumanFriendlyDates": "Używaj przyjaznych dla użytkownika dat",
"settings.weekStart": "Pierwszy dzień tygodnia",
"settings.0": "Niedziela",
"settings.1": "Poniedziałek",
"drawer.tabs.attributes": "Atrybuty",
"drawer.tabs.filters": "Filtry",
"drawer.tabs.sorting": "Sortowanie",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/pt.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"settings.zoom": "Zoom",
"settings.disableAnimations": "Desativar animações",
"settings.useHumanFriendlyDates": "Usar datas amigáveis",
"settings.weekStart": "Primeiro dia da semana",
"settings.0": "Domingo",
"settings.1": "Segunda-feira",
"drawer.tabs.attributes": "Atributos",
"drawer.tabs.filters": "Filtros",
"drawer.tabs.sorting": "Ordenação",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/ru.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"settings.zoom": "Масштаб",
"settings.disableAnimations": "Отключить анимации",
"settings.useHumanFriendlyDates": "Использовать удобочитаемые даты",
"settings.weekStart": "Первый день недели",
"settings.0": "Воскресенье",
"settings.1": "Понедельник",
"drawer.tabs.attributes": "Атрибуты",
"drawer.tabs.filters": "Фильтры",
"drawer.tabs.sorting": "Сортировка",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/tr.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"settings.zoom": "Yakınlaştırma",
"settings.disableAnimations": "Animasyonları devre dışı bırak",
"settings.useHumanFriendlyDates": "İnsan dostu tarihleri kullan",
"settings.weekStart": "Haftanın ilk günü",
"settings.0": "Pazar",
"settings.1": "Pazartesi",
"drawer.tabs.attributes": "Özellikler",
"drawer.tabs.filters": "Filtreler",
"drawer.tabs.sorting": "Sıralama",
Expand Down
3 changes: 3 additions & 0 deletions src/locales/zh.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
"settings.zoom": "缩放",
"settings.disableAnimations": "禁用动画",
"settings.useHumanFriendlyDates": "使用人性化日期",
"settings.weekStart": "一周的第一天",
"settings.0": "星期日",
"settings.1": "星期一",
"drawer.tabs.attributes": "属性",
"drawer.tabs.filters": "过滤器",
"drawer.tabs.sorting": "排序",
Expand Down
4 changes: 4 additions & 0 deletions src/main/config.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,10 @@ const config: Store<Settings> = new Store<Settings>({
store.set('fileWatcherPolling', false);
store.set('fileWatcherPollingInterval', 100);
},
'2.0.13': store => {
console.log('Migrating from 2.0.12 → 2.0.13');
store.set('weekStart', 1);
},
}
});

Expand Down
19 changes: 7 additions & 12 deletions src/main/modules/ProcessDataRequest/ProcessTodoObjects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ function handleCompletedTodoObjects(todoObjects: TodoObject[]): TodoObject[] {
const showCompleted: boolean = config.get('showCompleted');
return todoObjects.map((todoObject: TodoObject) => {
if(todoObject.complete && !showCompleted) {
todoObject.visible = false;
return false;
} else {
return todoObject;
}
return todoObject;
});
}

Expand All @@ -74,20 +75,14 @@ function handleTodoObjectsDates(todoObjects: TodoObject[]): TodoObject[] {
const thresholdDateInTheFuture: boolean = config.get('thresholdDateInTheFuture');
const dueDateInTheFuture: boolean = config.get('dueDateInTheFuture');

return todoObjects.map((todoObject: TodoObject) => {
return todoObjects.filter((todoObject: TodoObject) => {
if (!todoObject.visible) return true;

if(!todoObject.visible) return todoObject;

const thresholdDate = dayjs(todoObject?.t);
const dueDate = dayjs(todoObject?.due);

if(thresholdDate && thresholdDate.isAfter(dayjs()) && !thresholdDateInTheFuture) {
todoObject.visible = false;
} else if(dueDate && dueDate.isAfter(dayjs()) && !dueDateInTheFuture) {
todoObject.visible = false;
}

return todoObject;
return !(thresholdDate && thresholdDate.isAfter(dayjs()) && !thresholdDateInTheFuture) &&
!(dueDate && dueDate.isAfter(dayjs()) && !dueDateInTheFuture);
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/renderer/Drawer/Attributes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const DrawerAttributes: React.FC<DrawerAttributesProps> = memo(({
Object.keys(attributes).forEach((key) => {
if (attributes[key]) {
const count = attributes[key].count;
const formattedValues = settings.useHumanFriendlyDates && isDate ? friendlyDate(key, attributeKey, settings.language, t) : [key];
const formattedValues = settings.useHumanFriendlyDates && isDate ? friendlyDate(key, attributeKey, settings, t) : [key];

formattedValues.forEach((formattedValue) => {
if (!processedAttributes[formattedValue]) {
Expand Down
8 changes: 7 additions & 1 deletion src/renderer/Grid/DatePickerInline.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ import { handleFilterSelect, friendlyDate } from '../Shared';
import { withTranslation } from 'react-i18next';
import { i18n } from '../Settings/LanguageSelector';
import dayjs from 'dayjs';
import updateLocale from 'dayjs/plugin/updateLocale';
dayjs.extend(updateLocale);

const { ipcRenderer } = window.api;

Expand All @@ -31,6 +33,10 @@ const DatePickerInline: React.FC<Props> = ({
const [open, setOpen] = useState(false);
const chipText = type === 'due' ? "due:" : type === 't' ? "t:" : null;

dayjs.updateLocale(settings.language, {
weekStart: settings.weekStart,
});

const handleChange = (date: dayjs.Dayjs | null) => {
try {
ipcRenderer.send('writeTodoToFile', todoObject.id, todoObject.string, false, type, dayjs(date).format('YYYY-MM-DD'));
Expand All @@ -55,7 +61,7 @@ const DatePickerInline: React.FC<Props> = ({
const ButtonField = ({ ...props }) => {
const { disabled, InputProps: { ref } = {}, inputProps: { 'aria-label': ariaLabel } = {} } = props;
const mustNotify = (type === 'due') ? !todoObject?.notify : true;
const formattedValue = settings.useHumanFriendlyDates && dayjs(date).isValid() ? friendlyDate(date, type, settings.language, t).pop() : date;
const formattedValue = settings.useHumanFriendlyDates && dayjs(date).isValid() ? friendlyDate(date, type, settings, t).pop() : date;

const selected = filters && type !== null && (filters[type as keyof Filters] || []).some((filter: Filter) => {
return filter.values.includes(date);
Expand Down
3 changes: 3 additions & 0 deletions src/renderer/Header/Search/Input.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
}
.MuiButtonBase-root {
border: none;
svg {
color: $blue;
}
svg.invert {
transform: rotate(180deg);
}
Expand Down
Loading

0 comments on commit 340fd37

Please sign in to comment.