Sort:  

Great job buddy !! the idea you had looks awesome :) What i would suggest is to implement aswell a function that also analyses text even if it is on another line...I believe a lot will do this mistake so why not implement it ! :)

quoting your code:

function findMentionLine(comment) {
    return comment.split(/\r?\n/).find(line => line.includes('@' + REMAIND_ME_USERNAME)) || null;
}

function getFutureDateByTextAndContext(text, context) {
    return chrono.parseDate(text, context);
}

function getFurureDateByCommentTextAndContextDate(commentText, contextDate) {
    const mentionText = findMentionLine(commentText);
    const future = getFutureDateByTextAndContext(mentionText || '', moment(contextDate));
    return future ? moment(future) : null;
}

In terms of coding that will not be even a big issue for you. Just read each line of the comment and assign it in to an array of strings (each line of the comment as one element of the array) then loop through the array as per array.length (that will let the code know that if the array.length > 1 there are more lines to look at) and do a text matching into a couple IF statement containing some keyword as (Day, Hour, Minute, etc...) to know where to start looking for the time of the set reminder then pass the result to the other functions.

Again great job man !! i will for sure use it !! and by the way i already forked your repo to keep up to date with whatever you will implement :)

Hey!

In the very beginning the entire comment text was allowed to be parsed in order to search for a target date.

What I was concern about was that a random text might be picked by a search algorithm instead of user-intended one.

It's important, as even ordinary words matter, like "today", so a comment starting with "How are you today?" might fool an algorithm.

That might be tricky, so eventually decided to use one-line rule, as it's more secure, but - as you pointed correctly - less user friendly.

Really appreciate your input. Thank you for your comment!
All the best!

Thank you for your answer!!

I agree that a comment such as "how are you today" could fool the algorythm but in the meantime whoever will tag remind-me is already aware of what he is doing so i dont think he might write such comment.

The only possibility i forsee is that he could write his date/time on another line.

Still the "how are you today" example could be excluded by the algorythm since a reminder will have any date/time keywords but the most important thing is they will use AT or ON as a prefix to their messages most of the time like "ON the 2th of June 2019" or " AT 5:00 a. m.". Thus filtering aswell using this keywords will help in detecting REAL reminders.

Again great job and keep the good work up!!

Cheers

Thanks for the contribution. This will be useful for sure. :) I will try to take advantage of it.

One small note, it seems there is a small typo on that function.


Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


Need help? Write a ticket on https://support.utopian.io/.
Chat with us on Discord.
[utopian-moderator]

Thank you for your moderation effort and a note!
Cheers.

@remind-me in 2 minutes

Hey @emrebeyler, I will notify you on July 8th 2018, 8:27:24 pm (UTC)
Later!

Hi @emrebeyler!
You asked me in this comment to create a reminder.
It seems the time has passed!

@remind-me in -2 minutes

It does not dectect the input when it is in a comment of a comment :P read well the description and code :) it just detects for now when it is a single lined string and when it is a main comment to the post !! This is why your last reminder did not work @emrebeyler

@remind-me tomorrow

it works :)

Hey @adasq, I will notify you on July 10th 2018, 12:00:00 pm (UTC)
Later!

LOL okay...i was wrong !! reading the post again: Calling remind-me in posts won't create a reminder. :)

Hi @adasq!
You asked me in this comment to create a reminder.
It seems the time has passed!

-2 minutes seem not to be a valid date, that is why it is ignored.

Hey @adasq
Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Congratulations @adasq! You have completed the following achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of upvotes

Click on the badge to view your Board of Honor.
If you no longer want to receive notifications, reply to this comment with the word STOP

Do not miss the last post from @steemitboard:
SteemitBoard World Cup Contest - The results, the winners and the prizes

Do you like SteemitBoard's project? Then Vote for its witness and get one more award!

Congratulations @adasq! You have completed the following achievement on Steemit and have been rewarded with new badge(s) :

Award for the number of comments received

Click on the badge to view your Board of Honor.
If you no longer want to receive notifications, reply to this comment with the word STOP

Do not miss the last post from @steemitboard:
SteemitBoard and the Veterans on Steemit - The First Community Badge.

Do you like SteemitBoard's project? Then Vote for its witness and get one more award!