Giter Site home page Giter Site logo

Using Week Planner-view to move an event/task between days adds wrong "scheduled emoji" (⏳ vs ⌛️) about obsidian-day-planner HOT 2 CLOSED

esodesod avatar esodesod commented on September 21, 2024 3
Using Week Planner-view to move an event/task between days adds wrong "scheduled emoji" (⏳ vs ⌛️)

from obsidian-day-planner.

Comments (2)

ivan-lednev avatar ivan-lednev commented on September 21, 2024 1

Hello, @esodesod! Thank you for such a detailed description! Easy fix 😌

Please update and re-check.

from obsidian-day-planner.

esodesod avatar esodesod commented on September 21, 2024

I'm no developer, but simply tested using a "dirty" replace on the emoji(s) I found in the files below, did a (re)build, and it seems to work as expected (using the very same emoji as e.g. Obsidian Tasks, also when moving tasks between days using "Week Planner").

I can create a PR if this is the correct files/modifications, or you (or any other with better coding skills than me) can review, if possible.

Again, thanks for the work on this plugin!

diff --git a/src/regexp.ts b/src/regexp.ts
index 2f6f96a..e7c8e42 100644
--- a/src/regexp.ts
+++ b/src/regexp.ts
@@ -35,4 +35,4 @@ export const keylessScheduledPropRegExp = new RegExp(
   `(\\(scheduled\\s*::\\s*)${date}(\\))`,
 );
 
-export const shortScheduledPropRegExp = new RegExp(`(⌛\\s*)${date}`);
+export const shortScheduledPropRegExp = new RegExp(`(⏳\\s*)${date}`);
diff --git a/src/ui/hooks/use-edit/tests/diff.test.ts b/src/ui/hooks/use-edit/tests/diff.test.ts
index 16377bc..91b3055 100644
--- a/src/ui/hooks/use-edit/tests/diff.test.ts
+++ b/src/ui/hooks/use-edit/tests/diff.test.ts
@@ -18,7 +18,7 @@ describe("Finding diff before writing updates to files", () => {
         updated: [
           expect.objectContaining({
             id: baseTask.id,
-            firstLineText: expect.stringContaining(`⌛ ${nextDayKey}`),
+            firstLineText: expect.stringContaining(`⏳ ${nextDayKey}`),
           }),
         ],
       }),
diff --git a/src/util/task-utils.ts b/src/util/task-utils.ts
index dce10ba..ebabe60 100644
--- a/src/util/task-utils.ts
+++ b/src/util/task-utils.ts
@@ -87,7 +87,7 @@ export function updateScheduledPropInText(text: string, dayKey: string) {
     return updated;
   }
 
-  return `${text} ⌛ ${dayKey}`;
+  return `${text} ⏳ ${dayKey}`;
 }
 
 export function updateTaskText(task: Task) {

from obsidian-day-planner.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.