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

insert a newline in Insert Date String #27

Open
smcnally opened this issue Jan 22, 2023 · 2 comments
Open

insert a newline in Insert Date String #27

smcnally opened this issue Jan 22, 2023 · 2 comments

Comments

@smcnally
Copy link

In Settings ... Insert Date String: Format
This works great:

# YYMMDD - #### H:mmA

Can I insert a newline so a Format value like

# YYMMDD \n #### H:mmA

inserts

# YYMMDD
#### H:mmA

I've tried with and without single- and double quotes around newline and carriage return characters. No luck so far. \n, \r, 0xA and 0xD

Thank you for this extension -- long-time listener; first-time caller

@hseliger
Copy link

From what I can see, the function uses Javascript's now.format() method, which only supports literal strings, but afaik unfortunately does not expand special characters. So I guess you're out of luck.

Two possible alternatives: create a macro to first insert the date, then a newline, then the time (you can call the extension's function to insert the time/date stamps).

Alternative 2, better yet more complex: provide a patch for insertdatestring to first call now.format() to format the date string, and then expand the formatting codes (where I don't know a quick solution, but would assume that one of the string formatting methods should do the trick).

@smcnally
Copy link
Author

many thanks - will work at these alternatives and follow up here. much obliged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants