dannyfritz / atom-date Goto Github PK
View Code? Open in Web Editor NEWAtom package to insert the current date & time.
Home Page: https://atom.io/packages/date
License: MIT License
Atom package to insert the current date & time.
Home Page: https://atom.io/packages/date
License: MIT License
Just a request to add week numbers to be inserted.
When I set the format to "YYYY-MM-DD DDD"
The result is 2017-09-20 263
I need to change the timezone to UTC, however I see no documentation for this.
I'd like to be able to specify a datetime format other than <DATE> <TIME>
, but e.g. <DATE>T<TIME>
(aka EDTF). I guess a separate format field for datetime would do the trick.
Whichever command I choose ends up inserting the info into the document twice. E.g.
2015-09-012015-09-01
This is on Atom 1.0.9
How do I specify the format? It would be nice to have this info in the readme as well.
As pointed out by #17, do a publish to update the docs in Atom as well as on GitHub.
I am new to Atom, can you tell what i need to add to keymap.cson, so i can have date and time inserted with shortcut ?
Lets say i want to insert Data and Time when i press key CTRL+M
Or it can be CTRL+; like in google sheet
Is it possible to have a snippet that (among other things) inserts the current date/time?
[Enter steps to reproduce below:]
Atom Version: 1.1.0
System: Microsoft Windows 7 Home Premium
Thrown From: date package, v1.1.0
Uncaught TypeError: Cannot read property '0' of undefined
At C:\Users\ngunyi\.atom\packages\date\node_modules\date-utils\lib\date-utils.js:1429
TypeError: Cannot read property '0' of undefined
at toFormat (C:\Users\ngunyi\.atom\packages\date\node_modules\date-utils\lib\date-utils.js:1429:53)
at Date.toFormat (C:\Users\ngunyi\.atom\packages\date\node_modules\date-utils\lib\date-utils.js:1360:16)
at get (C:\Users\ngunyi\.atom\packages\date\lib\date.js:34:20)
at atom-text-editor.dateDate (C:\Users\ngunyi\.atom\packages\date\lib\date.js:9:12)
at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (C:\Users\ngunyi\AppData\Local\atom\app-1.1.0\resources\app.asar\src\command-registry.js:243:29)
at C:\Users\ngunyi\AppData\Local\atom\app-1.1.0\resources\app.asar\src\command-registry.js:3:61
at CommandPaletteView.module.exports.CommandPaletteView.confirmed (C:\Users\ngunyi\AppData\Local\atom\app-1.1.0\resources\app.asar\node_modules\command-palette\lib\command-palette-view.js:159:32)
at CommandPaletteView.module.exports.SelectListView.confirmSelection (C:\Users\ngunyi\AppData\Local\atom\app-1.1.0\resources\app.asar\node_modules\atom-space-pen-views\lib\select-list-view.js:338:21)
at space-pen-li.<anonymous> (C:\Users\ngunyi\AppData\Local\atom\app-1.1.0\resources\app.asar\node_modules\atom-space-pen-views\lib\select-list-view.js:139:19)
at HTMLOListElement.jQuery.event.dispatch (C:\Users\ngunyi\AppData\Local\atom\app-1.1.0\resources\app.asar\node_modules\jquery\dist\jquery.js:4435:9)
at HTMLOListElement.elemData.handle (C:\Users\ngunyi\AppData\Local\atom\app-1.1.0\resources\app.asar\node_modules\jquery\dist\jquery.js:4121:28)
19x -4:35.5.0 core:delete (atom-text-editor.editor.vim-mode.insert-mode.is-focused)
-4:30.3.0 autocomplete-plus:confirm (atom-text-editor.editor.vim-mode.insert-mode.is-focused.autocomplete-active)
-4:29.5.0 editor:newline (atom-text-editor.editor.vim-mode.insert-mode.is-focused)
17x -4:28.7.0 core:backspace (atom-text-editor.editor.vim-mode.insert-mode.is-focused)
-3:48.3.0 command-palette:toggle (atom-text-editor.editor.vim-mode.insert-mode.autocomplete-active.is-focused)
-3:47 application:minimize (atom-text-editor.editor.vim-mode.insert-mode.autocomplete-active)
-3:42.4.0 command-palette:toggle (atom-text-editor.editor.vim-mode.insert-mode.autocomplete-active.is-focused)
6x -3:39.9.0 core:backspace (atom-text-editor.editor.mini.is-focused)
-3:34 date:date (atom-text-editor.editor.vim-mode.insert-mode.autocomplete-active)
2x -3:03.2.0 command-palette:toggle (ul.list-inline.tab-bar.inset-panel)
-2:51.5.0 date:date (atom-text-editor.editor.vim-mode.insert-mode.autocomplete-active)
17x -2:03.3.0 core:backspace (atom-text-editor.editor.vim-mode.insert-mode.autocomplete-active.is-focused)
-2:00.5.0 command-palette:toggle (atom-text-editor.editor.vim-mode.insert-mode.is-focused)
-1:55.5.0 date:time (atom-text-editor.editor.vim-mode.insert-mode)
-0:25.4.0 command-palette:toggle (atom-text-editor.editor.vim-mode.insert-mode.is-focused)
-0:15.6.0 date:date (atom-text-editor.editor.vim-mode.insert-mode)
{
"core": {
"disabledPackages": [
"vim-mode-plus"
]
}
}
# User
date, v1.1.0
markdown-table-formatter, v2.5.4
markdown-writer, v2.0.1
vim-mode, v0.62.0
# Dev
No dev packages
Use a config schema instead. See the configuration section
of https://atom.io/docs/latest/hacking-atom-package-word-count and
https://atom.io/docs/api/latest/Config for more details
Package.activateConfig (C:\Users\Mateusz\AppData\Local\atom\app-0.205.0\resources\app.asar\src\package.js:263:11)
PackageDetailView.activate (C:\Users\Mateusz\AppData\Local\atom\app-0.205.0\resources\app.asar\node_modules\settings-view\lib\package-detail-view.js:163:26)
PackageDetailView.initialize (C:\Users\Mateusz\AppData\Local\atom\app-0.205.0\resources\app.asar\node_modules\settings-view\lib\package-detail-view.js:146:12)
PackageDetailView.View (C:\Users\Mateusz\AppData\Local\atom\app-0.205.0\resources\app.asar\node_modules\atom-space-pen-views\node_modules\space-pen\lib\space-pen.js:184:25)
new PackageDetailView (C:\Users\Mateusz\AppData\Local\atom\app-0.205.0\resources\app.asar\node_modules\settings-view\lib\package-detail-view.js:38:54)
<unknown> (C:\Users\Mateusz\AppData\Local\atom\app-0.205.0\resources\app.asar\node_modules\settings-view\lib\settings-view.js:255:22)
I have the following custom date format:
+------------------+
| YYYY-MM-DD (DDD) |
+------------------+
Before I updated to version 2.0.0 this resulted in dates that looked like:
+------------------+
| 2017-08-30 (Wed) |
+------------------+
After the update, the same formatter spits out:
+------------------+| 2017-09-20 (263) |+------------------+
Use activationCommands
instead of activationEvents
in your package.json
Commands should be grouped by selector as follows:
"activationCommands": {
"atom-workspace": ["foo:bar", "foo:baz"],
"atom-text-editor": ["foo:quux"]
}
Package.getActivationCommands (C:\Users\Mateusz\AppData\Local\atom\app-0.201.0\resources\app.asar\src\package.js:808:9)
Package.hasActivationCommands (C:\Users\Mateusz\AppData\Local\atom\app-0.201.0\resources\app.asar\src\package.js:733:20)
<unknown> (C:\Users\Mateusz\AppData\Local\atom\app-0.201.0\resources\app.asar\src\package.js:185:24)
Package.measure (C:\Users\Mateusz\AppData\Local\atom\app-0.201.0\resources\app.asar\src\package.js:163:15)
Package.load (C:\Users\Mateusz\AppData\Local\atom\app-0.201.0\resources\app.asar\src\package.js:177:12)
PackageManager.loadPackage (C:\Users\Mateusz\AppData\Local\atom\app-0.201.0\resources\app.asar\src\package-manager.js:355:14)
Could you add some examples of how to change the format using date-fns?
As date-fns supports different languages, I wonder whether it is possible to add this feature to this tool?
The settings for "Date Time Format" reads... "If left blank, this will default to Date Format + Time Format". However, it is not and another format is used.
For example, given the following:
Date Format = [blank] (therefore DD-MM-YYYY)
Time Format = [blank] (therefore HH:mm)
We expect the Date Time Format to be generated as DD-MM-YYYY HH:mm.
However, it is not. Another format is used.
For example, the following is generated: "2017-12-06T08:43:28.802-07:00"
But, it should be generated as: "06-12-2017 08:43"
The work-around is to explicitly set Date Time Format to "DD-MM-YYYY HH:mm"
(For interest, it is not possible to set Date Format or Time Format to its "default value")
Btw, thanks for creating this package!
I'd like to be able to define a Format like this:
HH24:MI\n
... so that it inserts a new line after the time stamp. Currently it escapes "\n" prior to inserting. Any way to achieve that? Thanks!
I tried to add a keybinding for date:time but it doesn't work. My guess is that this is the case since it is rather unclear to what piece of atom it should be related.
I tried:
'atom-date': 'ctrl-alt-t': 'date:time'
as well as:
'date': 'ctrl-alt-t': 'date:time'
Both don't work.
Thanks in advance
atom.workspaceView is no longer available.
In most cases you will not need the view. See the Workspace docs for
alternatives: https://atom.io/docs/api/latest/Workspace.
If you do need the view, please use atom.views.getView(atom.workspace)
,
which returns an HTMLElement.
Atom.Object.defineProperty.get (/usr/share/atom/resources/app/src/atom.js:54:11)
Object.activate (/home/michael/.atom/packages/date/lib/date.js:7:9)
How can i use is in my project with snippets.cson?
Hi! is it feasible to add timezones as a format option? I'd love to be able to insert a full ISO8601 date string including the timezone into my work.
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.