-
-
Notifications
You must be signed in to change notification settings - Fork 153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add visual cue for overdue headers when displaying headers #970
base: master
Are you sure you want to change the base?
Conversation
@@ -0,0 +1,40 @@ | |||
GNU nano 6.2 index.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think that file was committed accidentally?
'-' + | ||
headerDeadlineMap.get('year') | ||
) | ||
: today; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand how you construct this new Date()
.
When I enter this weird order of arguments in node:
> Date('01-05-2022')
'Wed Nov 29 2023 21:54:27 GMT+0100 (Central European Standard Time)'
I'd suggest to pass a date in ISO format.
I am open to any suggestions and changes that you might recommend.
The basic premise is that I take the date a header is due and subtract
today (the time is stripped off - so everything is assumed to be midnight
00:00.00)
If the result is negative, then the header is due in the past and the date
is surrounded by ** **
If the result is 0 or a positive number, then the header is due in the
future and the date is displayed normally.
I am a very amateur coder - so I ended up structuring this code after some
examples I found online. That code took the date in the format 11-29-2023
(for today)
I am not bound to any of the code - and I will gladly take any
recommendations you want to make.
…On Wed, Nov 29, 2023 at 4:05 PM Jakob Schöttl ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/components/OrgFile/components/TitleLine/hardcopy.0
<#970 (comment)>:
> @@ -0,0 +1,40 @@
+ GNU nano 6.2 index.js
I think that file was committed accidentally?
------------------------------
In src/components/OrgFile/components/Header/index.js
<#970 (comment)>:
> @@ -361,6 +361,21 @@ ${header.get('rawDescription')}`;
headerDeadlineMap.get('year')
: '';
+ const today = new Date();
+ const headerDate =
+ headerDeadlineMap !== undefined
+ ? new Date(
+ headerDeadlineMap.get('month') +
+ '-' +
+ headerDeadlineMap.get('day') +
+ '-' +
+ headerDeadlineMap.get('year')
+ )
+ : today;
I don't understand how you construct this new Date().
When I enter this weird order of arguments in node:
> Date('01-05-2022')'Wed Nov 29 2023 21:54:27 GMT+0100 (Central European Standard Time)'
I'd suggest to pass a date in ISO format.
—
Reply to this email directly, view it on GitHub
<#970 (review)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC3NKETBGA7UKCSYO75F7PLYG6PQTAVCNFSM6AAAAABAABVYFOVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTONJWGE4DGNRQG4>
.
You are receiving this because you authored the thread.Message ID:
***@***.***>
|
Maybe you can add a screenshot to your PR description above for people to see how it will look. You can try your JavaScript in the JS console of your browser (just press F12). Try your Also you would need to use git rebase to remove that invalid file, the nano screen dump. |
When you enabled displaying header due dates on the right side of the screen a new visual cue (i.e. 11-29-2023) has been added to clearly identify and separate overdue items from future items.