Action

Fuzzy Dates

Posted by yitta bitta, Last update about 1 month ago

Wrap selection in semicolons for use with unofficial roam-toolkit’s Fuzzy Date feature.

Remixed by @yittabitta from @nativeneil’s Create Roam Link

Steps

  • script

    // Apply semicolons to selection, or insert ;; if no selection
    
    var sel = editor.getSelectedText();
    var selRange = editor.getSelectedRange();
    
    if (!sel || sel.length == 0) {
      editor.setSelectedText(";;");
      editor.setSelectedRange(selRange[0]+2,0);
    }
    else {
      editor.setSelectedText(";"+sel+";");
      editor.setSelectedRange(selRange[0]+selRange[1]+2,0);
    }
    

Options

  • After Success Nothing
    Notification None
    Log Level None
Items available in the Drafts Directory are uploaded by community members. Use appropriate caution reviewing downloaded items before use.