Skip to content

added text option#23

Merged
olsh merged 6 commits into
olsh:masterfrom
yonka2019:master
Apr 2, 2023
Merged

added text option#23
olsh merged 6 commits into
olsh:masterfrom
yonka2019:master

Conversation

@yonka2019
Copy link
Copy Markdown
Contributor

added option to set text and datetime to duedate of item.

This could be used when recurring needed from X date.
'every day from X' isn't really enables recurring, there is a bug.

@olsh
Copy link
Copy Markdown
Owner

olsh commented Apr 1, 2023

Hi @yonka2019

Thank you for your contribution.
Could we update this overload by adding the optional DateTime? date = null parameter?

public DueDate(string text, string timezone = null, Language language = null)
{
Text = text;
Timezone = timezone;
Language = language;
}

Like this

        public DueDate(string text, DateTime? date = null, string timezone = null, Language language = null)
        {
            Text = text;
            Timezone = timezone;
            Language = language;
            Date = date;
        }

What do you think?

Also, I believe that the overload needs more clear comments, especially about the text and date parameters.

@olsh olsh self-requested a review April 1, 2023 16:36
@yonka2019
Copy link
Copy Markdown
Contributor Author

yeah I think it would be better.
Where do you mean to add more comments? at the code? or at the commit description

@olsh
Copy link
Copy Markdown
Owner

olsh commented Apr 1, 2023

Where do you mean to add more comments? at the code? or at the commit description

Yes, I meant comments in the code.

Copy link
Copy Markdown
Owner

@olsh olsh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please fix the build?

@olsh
Copy link
Copy Markdown
Owner

olsh commented Apr 2, 2023

@yonka2019
I've just tried to reproduce the initial issue

This could be used when recurring needed from X date.
'every day from X' isn't really enables recurring, there is a bug.

And it looks like it works, here is the code

            var item = new Item("demo task") { DueDate = new DueDate("Every day from 20 Apr", language: Language.English) };
            await client.Items.AddAsync(item).ConfigureAwait(false);

Could you please send me the code that reproduces the issue?

@yonka2019
Copy link
Copy Markdown
Contributor Author

Could you please send me the code that reproduces the issue?

yeah, I changed the due date to already created item (shifted the date by one, and added recurring of every 3 days.
for example:
task.DueDate = new DueDate($"{task.DueDate.Date.Value.AddDays(1).ToShortDateString().Replace(".", "/")} every 3 days");
'// 03/04/2023 every 3 days'

the todoist shows like the recurring is enabled, but really - when you marking the task as done, it doesn't re-creates her-self.

@olsh
Copy link
Copy Markdown
Owner

olsh commented Apr 2, 2023

Yeah, managed to reproduce the issue.

@yonka2019
I've slightly changed the final constructor, not sure if isFullDay parameter makes any sense when using text for due date creation.
Please let me know what you think.

@yonka2019
Copy link
Copy Markdown
Contributor Author

I've slightly changed the final constructor, not sure if isFullDay parameter makes any sense when using text for due date creation.
Please let me know what you think.

it makes sense because without that, it will start from X date 21:00

@olsh
Copy link
Copy Markdown
Owner

olsh commented Apr 2, 2023

it makes sense because without that, it will start from X date 21:00

Got it. Thank you for your contribution.

@olsh olsh merged commit c091e21 into olsh:master Apr 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants