-
-
Notifications
You must be signed in to change notification settings - Fork 524
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
Feature - add bracketed date support when composing new entry (#1915) #1918
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -51,6 +51,13 @@ Feature: Reading and writing to journal with custom date formats | |
| little_endian_dates.yaml | 2032-02-01: Test. | 01.02.2032 09:00 Test. | | ||
| little_endian_dates.yaml | 2020-01-01: Test. | 01.01.2020 09:00 Test. | | ||
| little_endian_dates.yaml | 2020-12-31: Test. | 31.12.2020 09:00 Test. | | ||
# @todo: is it fine that default time be used here and not 00:00? | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question: is this behavior fine? |
||
| little_endian_dates.yaml | [2020-12-31] bracket. | 31.12.2020 09:00 bracket. | | ||
| little_endian_dates.yaml | [2020-12-31 10:00 PM] brkt. | 31.12.2020 22:00 brkt. | | ||
| little_endian_dates.yaml | [2020-12-31]: brkt colon. | 31.12.2020 09:00 brkt colon. | | ||
| little_endian_dates.yaml | [2020-12-31 12:34]: b colon. | 31.12.2020 12:34 b colon. | | ||
| little_endian_dates.yaml | [2019-02-29] brkt neg. | [2019-02-29] brkt neg. | | ||
| little_endian_dates.yaml | [2020-08-32] brkt neg. | [2020-08-32] brkt neg. | | ||
|
||
|
||
Scenario Outline: Searching for dates with custom date | ||
|
@@ -78,6 +85,14 @@ Feature: Reading and writing to journal with custom date formats | |
Then the output should contain "10.05.2013 09:00 I saw Elvis." | ||
And the output should contain "He's alive." | ||
|
||
Scenario: Writing an entry at the prompt with custom date in bracket format | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. note: could be integrated into test above as config |
||
Given we use the config "little_endian_dates.yaml" | ||
When we run "jrnl" and type "[2013-05-10 12:34] I saw Elvis. He's alive." | ||
Then we should get no error | ||
When we run "jrnl -999" | ||
Then the output should contain "10.05.2013 12:34 I saw Elvis." | ||
And the output should contain "He's alive." | ||
|
||
|
||
Scenario: Viewing today's entries does not print the entire journal | ||
# see: https://github.com/jrnl-org/jrnl/issues/741 | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,6 +16,31 @@ Feature: Starring entries | |
| empty_folder.yaml | | ||
| dayone.yaml | | ||
|
||
Scenario Outline: Starring an entry with bracketed date will mark it in the journal file | ||
Given we use the config "<config_file>" | ||
When we run "jrnl <command>" | ||
Then we should get no error | ||
When we run "jrnl -on 2013-07-20 -starred" | ||
Then the output should contain "2013-07-20 09:00 Best day of my life!" | ||
|
||
Examples: configs | ||
| config_file | command | | ||
| simple.yaml | [2013-07-20] Best day of my life! * | | ||
| empty_folder.yaml | [2013-07-20] Best day of my life! * | | ||
# Note: this one fail due to whitespace, cmp. next config | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. question: I assume the dayone Journal should also be supported without issues? Will have to check that |
||
# | dayone.yaml | [2013-07-20] Best day of my life! * | | ||
| dayone.yaml | [2013-07-20] Best day of my life!* | | ||
| simple.yaml | [2013-07-20]*: Best day of my life! | | ||
| empty_folder.yaml | [2013-07-20]*: Best day of my life! | | ||
| dayone.yaml | [2013-07-20]*: Best day of my life! | | ||
| simple.yaml | [2013-07-20] * : Best day of my life! | | ||
| empty_folder.yaml | [2013-07-20] * : Best day of my life! | | ||
| dayone.yaml | [2013-07-20] * : Best day of my life! | | ||
| simple.yaml | [2013-07-20] * Best day of my life! | | ||
| empty_folder.yaml | [2013-07-20] * Best day of my life! | | ||
# Note: this one fails in having the star in the output too | ||
# | dayone.yaml | [2013-07-20] * Best day of my life! | | ||
|
||
Scenario Outline: Filtering by starred entries will show only starred entries | ||
Given we use the config "<config_file>" | ||
When we run "jrnl -starred" | ||
|
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.
note: code is based on
Journal._parse
with slight adaptions. E.g. thedefault_hour
anddefault_minute
handling is added.