Code Monkey home page Code Monkey logo

insertdate's People

Contributors

fichtefoll avatar kerrizor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

insertdate's Issues

Default keybindings don't work on OS X Yosemite

super+F5 is the system-wide shortcut to toggle VoiceOver, an accessibility tool (on Yosemite, at least).

image

There's no way to disable this system-wide shortcut. When I type it in SublimeText3, it doesn't even register with ST3 or InsertDate. It just opens VoiceOver, and that's it.

Also, I don't know if I'm being stupid, but it won't let me edit the default InsertDate keybindings, and there is no "User" file for me to override them with.

But I think the real problem is that these are the defaults at all, since they can't work on OS X.

F5 .. ctrl-F5 any keybindings from InsertDate stopped working under KDE in Sublime either 4121 or 4126

Dear,

there seems to be a difficulty running InsertDate in Sublime recently - no key binding works either on KDE graphic environment in Ubuntu 22.04

Tested on two machines, having KDE as their GUI, two sublime builds, same problem:

F5 brings zero response from InsertDate. also other default keybinds for InsertDate.

Aside from that problem, the "usual" shortcuts in sublime e.g. ctrl-F for search - function normally.

Anyone having the same experiences and what is the way to inspect it further?

Thanks

System versions etc:

Machine1:
Ubuntu Studio 22.04
KDE Plasma 5.24.x
KDE framework: 5.94.x
QT: 5.15.x

Machine 2:
22.04
5.24.x
5.92.x
5.15.x

obviously subversions does not matter

both on X11

Vim support

Would be cool if insertDate works in vim too.. IMO
By the way Great package. πŸ˜„
πŸ‘

Don't require selecting a timezone

For example:

❯ echo 'import time; print(time.strftime("%c %Z"))' | python
Sat Dec 12 18:41:27 2015 CST

When traveling across timezones, I should only have to change the timezone configuration in one place: my OS.

Numpty question

Not wanting to sound like a numpty but failing dramatically, how do you actually use the plugin?

There's nothing in the command palette, and nothing in the Tools menu. Do you have to use it as a variable?

many thanks, Jake

Day of the week

Lovely plugin and nice tutorial, could you please add a =day of the week= format that prints
Mon
Tue
...

Update to pytz2013b

I have no idea what's changed (didn't download to check for a changelog) but updates are generally not a bad thing.

Please explain how to configure a keyboard shortcut

OK, I feel stupid, but can you please tell me exactly how to configure a keyboard shortcut to insert the ISO date in Sublime Text 3?

I have added:
// iso date (YYYY-MM-DD) { "keys": ["ctrl+shift+f5", "ctrl+shift+d"], "command": "insert_date", "args": {"format": "%Y-%m-%d"} }

To my Default (Linux) sublime-keymap - User file, but "ctrl+shift+f5" does not do anything.
What exactly am I doing incorrectly?

Thank you,

GG

Update pytz 2014g

Last update was on Semtember 8th, upstream update on Semtember 9thΒ β€” it contains 2014g with new timezones for Russia, which will be legit on October 26th, tomorrow.

Please, update asap.

Error message "Process being used by another process"

I have InsertDate installed in ST3 under Windows. It was working when I first installed it about 6 months ago. Now when I hit F5 to use the plugin nothing happens.

When I look for the User Settings (to try and reassign the hotkey) there is no entry for InsertDate under Package Settings menu. There are no entries for InsertDate under the Package Control menus either.

When I try and Remove Package to uninstall and reinstall - I get the following error:

Package Control: An error occcurred while trying to remove the installed 
package file for InsertDate.  

[WinError 32] The process cannot access the file because it is being used 
by another process: 'C:\\Users\Username\AppData\\Roaming\Sublime Text 3\Installed Packages\\InsertDate.sublime-package'

I get this error trying to uninstall the plugin, even after a fresh start of Sublime with no projects or files open in ST.

Latest release fails to insert date for me

Running ST2, Win 8.1. When trying to insert the date in the default format nothing shows up. The console displays this error:

[InsertDate]
TypeError: Parameter 'tz_out' = u'UTC' is not an instance of datetime.tzinfo

Thanks.

format parse err

Hi, I am trying this string "%A, %e %b %Y %Z %H:%M:%S "

http://strfti.me/ shows me "Thursday, 13 Feb 2014 GMT 15:45:54"

Sublime 3 shows "Error parsing format string"

Is this an bug? THanks

EDIT: It seems that the '%e' argument is causing the err. It should be the day of the month, without padding.

feature request : updated date

Hi,

Working with a lot of text pieces that are stored in database and duplicated in files, I would like to follow the age of a text block.
Could you add a feature like a snippet with date that could be automaticaly updated when a keystroke or a save is triggered ?

this could be <:[27/07/2015 10:26]:> or anything...

Thank you.

F5 not working on Sublime Text 2 for windows.

When I press F5 (for prompt)
I get this on the Sublime Text 2 status bar.

[InsertDate] prompt_config setting is invalid

here is my
insert_date.sublime-settings

    {
        ////////////////////////////////////////////////////////////////////////////
        // COPY THIS FILE TO YOUR USER SETTINGS BEFORE MODIFYING IT, OTHERWISE
        // CHANGES WILL BE OVERWRITTEN WITH EVERY UPDATE!
        //
        // Tip: Copy the file, select "Preferences > Package Settings >
        // InsertDate > Settings - User" and paste.
        ////////////////////////////////////////////////////////////////////////////

        // This is the format that will be used when no format has been specified
        // when calling the command. Also used for the "InsertDate: Default"
        // command from the command palette.
        // Default: '%c'
        "format": "%c",

        // Similar to above, this is the default timezone that will be used when
        // there was no other incoming timezone specified. Because the default is
        // set to 'local' it will be interpreted the timezone of your machine. As
        // of now, 'local' does not support the `%Z` named timezone representation
        // and it is HIGHLY RECOMMENDED to specify your local pytz timezone here.
        // Default: 'local'
        "tz_in": "local",

        // A set of pre-defined settings that are prompted by "promt_insert_time"
        // and previewed. You can modify this list in your User settings, but be
        // aware that you remove all these entries when overriding "prompt_config"!
        // Use "user_prompt_config" if you just want to add a few entries.
        //
        // `$default` is replaced by the "format" setting above, unspecified values
        // remain default.
        "prompt_config": [
            // Default timezone and formats
            { "name": "Default"
            },
            { "name": "Time",
              "format": "%X"
            },
            { "name": "Date",
              "format": "%x"
            },
            // UTC, iso (standards)
            { "name": "UTC",
              "tz_out": "UTC"
            },
            { "name": "UTC+",
              "format": "$default (UTC%z)",
              "tz_out": "UTC"
            },
            { "name": "iso",
              "format": "iso"
            },
            { "name": "UTC iso",
              "format": "iso",
              "tz_out": "UTC"
            },
            // Popular timezones
            { "name": "EST",
              "tz_out": "EST"
            },
            { "name": "EST+",
              "format": "$default (UTC%z)",
              "tz_out": "EST"
            },
            { "name": "PST",
              "tz_out": "PST8PDT"
            },
            { "name": "PST+",
              "format": "$default (UTC%z)",
              "tz_out": "PST8PDT"
            },
            { "name": "CET",
              "tz_out": "CET"
            },
            { "name": "CET+",
              "format": "$default (UTC%z)",
              "tz_out": "CET"
            }
        ],

        // Works similar to "prompt_config" but is added to the above list.
        // Supposed to be used by you when you just want to add some entries to the
        // list.
        "user_prompt_config": []
    }

any help if even possible would be greatly appreciated.

CTRL+F5 works fine, it adds the date in a format I specified, but well would be neat to have the whole thing working.

Default format from insert_date_panel / shortcut won't print

Hi, I'm trying to understand why only some of the showed formats are actually printing the date on the open file. My insert_date.sublime-settings file is an empty JSON.

For instance, CTRL+F5 + CTRL-d works, but CTRL+F5 + CTRL+F5 doesn't.

Even weirder, if I click F5 and press enter (I want the default format) it won't print anything, but F5 then second choice (Time) it works O_o. Same with the 4th choice (UTF8), no luck, but the 5th (UTF8+) works (and seems to be true for any TZ, works only in the "with +" variant).

I have the console open but I can't see any message related with InsertDate. Could I enable some kind of debugging feature to see what's going on?

Running Sublime Text 2 on Ubuntu 13.10

Thanks a lot

Bad version number

Sublime Package Control update my InsertDate plugin all the day.
I see this is a version number problem ( 1.0.1 in the package metadata and 2.0.1 in the Package Control website)

Thank you

not started to work on ST3 mac os x

Hi!
Thanks for a nice plugin.
I just installed it on Sublime Text 3 running on Mac OS X and when hitting F5 all I see is notice in status bar:
[InsertDate] Error parsing format string

in console I see
[InsertDate] Error parsing format string
UnknownTimeZoneError: "Parameter 'tz_out' = 'EST' is not a valid timezone name"

What to do to start using plugin?

Suggestion - Unix Time

hi there,
Love your plugin. I have modified it slightly, and thought you might like the addition.

I added the following two lines to the date_format function, just above the final return:

if format.startswith("Unix"):
    return str(time.time())

(note: you'll also need the time import, but you already knew that ;)

I find this very useful for when I need a unique, short timestamp.

Thanks for your consideration!

Strack

Make %Z work on locale timezone setting

At the moment, it is jsut an empty sting because I had troubles with it earlier (unicode issues in ST2 era).

It's been on my todo since the start, but I might as well list it here.

InsertDate suddenly stopped working

Today when I started Sublime, InsertDate has stopped working. The console log shows that the key strokes are generating the right calls, insert_date_panel and so on. None of them do anything: the panel never shows up, the prompt window never opens, and the ones with default formats do not insert anything.

I removed InsertDate and installed it with no change. I was getting log errors from ruby and rubytest and have disabled those, so now my python console is clean. It's just that nothing happens.

I hope you'll get this and have some advice. Thanks!

InsertDate don't use system tzdata

InsertDate plugin keeps the required pytz package in installed directory. Therefore that not affected on updating the system timezones. For example, my country changed transition but the plugin was not affected.

My workaround for this reason:

cp /usr/share/zoneinfo/Turkey ~/.config/sublime-text-3/Packages/pytz/all/pytz/zoneinfo/Europe/Istanbul
cp /usr/share/zoneinfo/Turkey ~/.config/sublime-text-3/Packages/pytz/all/pytz/zoneinfo/Asia/Istanbul
cp /usr/share/zoneinfo/Turkey ~/.config/sublime-text-3/Packages/pytz/all/pytz/zoneinfo/Turkey

Not working in Sublime Text 3 build 3143

InsertDate is no longer working after I upgraded to the released version of ST 3 (build 3143). The InsertDate options in command palette has disappeared.

Command palette in ST 3 build 3143
image

Compare to ST 2
image

How do i uninstall this package?

It seems that this package cannot be removed. Everytime when I remove it, it always remind me some error.
So, could you kindly tell me how to remove it, thank you very very much.

Unicode error

Reported by @vovkkk (source):

date format: %y-%b-%d %H:%M or just %b
env: Windows 7 with Russian l10n, ST 2.0.1 2217
error:

Traceback (most recent call last):
  File ".\sublime_plugin.py", line 356, in run_
  File ".\insert_date.py", line 38, in run
  File ".\encodings\utf_8.py", line 16, in decode
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 4-6: invalid data

If I replace utf-8 with cp1251 then it works as it should.

I'm not sure what way is best but here I've used this:

sys_enc = locale.getpreferredencoding()
text = text.decode(sys_enc) 

seems to work

New Feature: parse and reformat date in view

It would be nice to have a command to parse the selection in a view assuming it's a date, then present the user with a panel with the output formats to which the date can be transformed.

InsertDate ignores change of system timezone

This happened unexpectedly: our local parliament decided to change time zone; they took decision just in July, and it became legit this night; I knew about it just hour ago.
Crazy stuff.

Steps to reproduce:

  1. Set in settings "tz_in": "Asia/Novosibirsk"
  2. Paste time
  3. Compare with Yandex.Time

Expected result
UTC+7, e.g. 14:50

Actual
UTC+6, 13:50

user_prompt_config gets added every time I press F5

in my user settings I added a user_prompt_config pair:

{
    "user_prompt_config" : [
        {
            "name" : "TnC datetime",
            "format" : "%A %b %d, %Y %I:%M:%S%p %z"
        }
    ]
}

every time I press "F5" the configuration gets loaded and adds another line for "TnC datetime" to the selection list. Am I doing something wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.