scrod / nv

Notational Velocity: modeless, mouseless Mac OS X note-taking application
http://notational.net
GNU General Public License v3.0
2.07k stars 404 forks source link

Insert date #87

Open Mooie opened 14 years ago

Mooie commented 14 years ago

I'd like to be able to insert a date into NV with a keyboard short-cut similar to using "CMD /" in OmniFocus, which simple inserts dd/mm/yy. It'd save me quite a few key-strokes, not to mention having to glance up to find out (or remind myself) what the date actually is. Thanks for such a great app.

scrod commented 14 years ago

Such general-purpose functionality wouldn't make sense to add to Notational Velocity. Just use WordService (under the "Insert" menu it adds) from Devon Technologies, or an app like TextExpander or TypeIt4Me, which have abbreviations for inserting the current date/time. The benefit is that you'll then get these features in any app — not just NV.

ollelar commented 14 years ago

I second this enhancement. Both TextExpander and TypeIt4Me cost money. I'd rather pay for NV than those two apps.

I write date/time stamps all the time (usually when on the phone, so it has to be quick). I would prefer the format to be yyyy-mm-dd hh:mm (ISO 8601).

Advantages of using iso 8601 are:

Easily readable and writeable by systems Easily comparable and sortable Language independent Larger units are written in front of smaller units For most representations the notation is short and of constant length

Source: http://www.iso.org/iso/date_and_time_format

Mooie commented 14 years ago

I'd run with ISO 8601, but I'd like to be able to optionally exclude the time suffix as (most of the time) I don't need this. Like mrbazoo I need something quick. I thought scrod may suggest TextExpander or similar; however, I like to keep thing simple (one of the many reasons I use NV) and an out-of-the-box solution would work for me better. Besides, all the other apps I use regularly (which are few) have a built-in date stamp so I just don't need a system-wide solution. I see where scrod is coming from, but I feel that date and time stamping is a special case as it is so often used in note taking. And therefore such a feature should be an integral part of any and all note taking apps, NV included.

Zolarboy commented 13 years ago

Just wondering if this has been applied in notational velocity. I was using tomboy before notational velocity. I switched to notational velocity because it has password protection. But one feature I miss a lot is adding time stamp. Only date reference is date modified which changes every time I modify even a whitespace. Please add this feature and make NV my dearest. :) Thanks.

daviddelikat commented 12 years ago

I'm adding a vote for date/datetime stamp. I'd like to have it in the title entry field as well as the body.

divergio commented 12 years ago

To those complaining that TextExpander and TypeIt4Me cost money and who missed scrod's suggestion to use WordService, please consider these instructions to set a keyboard shortcut to insert date and time:

Step 1: Go to Devon Tech's download site, download WordService.zip You can read about it first if you want.

Step 2: Unzip, move the .services file to "~/Library/Services" Create the folder if it doesn't exist. If this instruction doesn't make sense, take a look at this

Step 3: Logout and log back on. (these instructions are from the Word Service readme)

Step 4: Go to your System Preferences, click "Keyboard," click "Keyboard Shortcuts," click "Services," scroll down to "Short Date."

Step 5: Set this to whatever key combination you want to use. I chose Command-Shift-5 for some reason.

Step 6: Test it out, open up a native OS X app and try that keyboard shortcut.

_But oh no, the date isn't in the ISO standard format I want!_

Step 7: WordService is simply using the built-in date and time variables of OS X. Go back to System Preferences. Select "Language & Text," select "Formats," select "Customize" in the Dates region.

Step 8: Move the bubbles around, insert dashes, and change date formats for "Short" until it looks the way you want. (On a side note, this dialogue box is one of the most powerful and intuitive configuration menus I've ever used.)

You should now be able to insert yyyy-mm-dd date stamps. I only use date, not time, but if you want to have date and time then repeat these instructions but in "Keyboard Shortcuts" set a key for "Short Date and Time." Then change the "Medium" "Times" setting in Language & Text Formats.

Following these instructions I was able to generate these results: 2011-10-19 2011-10-19 18:51

By modifying Step 8 you can generate almost any format. Cheers.

Mooie commented 12 years ago

Thanks divergio. That's very useful. I was the OP for this issue, and eventually came up with the same solution (once I realised you could alter the WordService time-format using System Preferences (as you explain in "Step 7" above)).

I have set "cmd-/" for date (2011-10-19) (the same as OmniFocus), "ctrl-cmd-/" for date-and-time (2011-10-19T12:12Z+0100), and "cmd-." for just time (T12:12Z+0100). All conforming to ISO 8601. (These shortcuts work in NV, but not in all apps.)

Just to say, there are some side effects when the global date and time preferences are set to conform with ISO 8601, as those formats will appear in other apps where perhaps they are not so ideal.

Best, Mooie

divergio commented 12 years ago

Good point, Mooie, there are side effects of changing those preferences. In practice I haven't encountered any because I don't think any user-facing parts of the OS use the "short" date value, at least.

jasim commented 12 years ago

There is also an easy way to do this without using WordService or any external app. You can just use Automator to create an automation which runs a shell script (date) and replaces the current selected text with its output. You can also assign it a global shortcut through System Preferences -> Keyboard Shortcuts.

Refer to http://superuser.com/questions/227213/what-is-the-easiest-way-to-get-a-yyyy-mm-dd-hhmmss-timestamp-hotkey-on-the-mac.

shrohdin commented 7 years ago

When I noticed @done shortcut behavior in nvALT (where it strikes through the line), I thought there might be a similar hidden @date function where you could get the date tagged to a spot, and so stumbled upon this old thread.

As much as I think a case could be made for adding an "@date" shortcut to nvALT, I understand that everyone has their own simple thing that would make everything perfect, and then before long, the app loved for its simplicity becomes more and more bloated, and not so simple anymore.

... I'll try the @divergio recommendation. thanks for keeping this thread around.