Skip to content
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

allow colon notation [HH:mm:ss] for remindme command [enhancement] #77

Open
timpunny opened this issue Jun 12, 2024 · 0 comments
Open
Labels
enhancement New feature or request

Comments

@timpunny
Copy link

timpunny commented Jun 12, 2024

image

Proposed solution in util.py:

def timefromstring(s):
    """
    :param s : String to parse time from
    :returns : Time in seconds
    """
    s = s.removeprefix("for")
    
    # reduce colon notation to hms notation
    if ':' in s:
        # if only one colon, assume Xm:Xs
        if s.count(':') == 1:
            s = f"0:{s}"
        s = s.replace(":", "h", 1).replace(":", "m", 1) + "s"
        
    return int(Duration(s).to_seconds())

I don't have write access so I can't create the edit myself, nor can I add the "enhancement" tag to this post, apparently. (This is my first time posting an issue on a repo I don't own so this is a bit confusing for me.)

@timpunny timpunny changed the title allow colon notation [HH:mm:ss] for remindme command allow colon notation [HH:mm:ss] for remindme command [enhancement] Jun 15, 2024
@joinemm joinemm added the enhancement New feature or request label Aug 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants