GP SoftwareTwitter
Opus FAQsManualCommandsObjects

Columns: Format My Date (define date columns using formatting syntax)

This idea came up while making another script which I'll post soon. It seemed like a general feature so I took it out into its own script. I didn't write the function that handles the formatting but took it from Jacob Wright.

Background: In Opus, the traditional approach to formatting dates has been to tweak the time and date settings at the Windows level under Region and Language.

But sometimes, it might be nice to have a date column in a custom format. This script lets you define date columns using the PHP date syntax, so you can have date columns like these:


The three custom columns above are defined with this simple syntax:

[code]'YMD' : {
target: "modify",
format: "ymd"
},

'D.M.Y' : {
target: "modify",
format: "d.m.y"
},

'the date' : {
target: "modify",
format: "D j M, Y"
}
[/code]

[] The format uses this PHP date format syntax.
[
] The target is one of several dates accessible for an Opus item.
[*] There are other configurable parameters (from justification to infotips), explained in detail in the script.

Something Special
If you look inside the script, you'll see there is also a facility to easily define "special columns" that are handled separately from the standard "Format My Date" columns.

How To Install
[] In Prefs, open the Scripts pane. Drag and drop the script to that panel, and check the checkbox to enable it.
[
] Add columns either manually the usual way (right-click the column header):


[*] Or add a column programmatically, for instance:

Set COLUMNSTOGGLE="scp:Format My Date/YourCoolColumnName"

It was a bit rushed, so feedback welcome! :slight_smile:

Updating:
ScriptWizard-compatible.

Download:
FormatMyDate.js.txt (23.5 KB)

Thanks for sharing your custom date column! o) Could you change the subject of your thread to match something like?
Column: FormatMyDate (custom date strings)
The prefix "Add-In:" is surely correct, but does not help to determine what kind of add-in. That prefix also hasn't been used before, so it does create unnessary noise in the list of available things. Just a recommendation, I'm not a moderator. o)

Hi tbone, thank you for explaining the thread naming convention, that's done.
Also I was wondering if you could please let me know if there's anything missing for compatibility with your ScriptWizard.
I re-upped using the "Prepare for Upload" feature, hope it's alright.
Thanks!

You're welcome and thanks as well! o) Regarding the SW support, you did quite correct so far - script-id and script-url are set just right and the about-feature is working perfectly, I tried! o)

The only thing to do is: Place your attachment "inline" and fill the file-comment located in the "Attachments" section (on the right hand side) with version/date information. I recommend something like "v / - ". This could look similar to this for your recent upload "v1.01 / 2015.06.19 - intial version (SW support added)". Currently, the version-string you put "somewhere", cannot be connected to your attachment, as it is just text with no reference to the script-upload. This results in SW not finding any version information, auto-updating does not work currently.

The best thing to make sure everything works as desired is trying to update your own local script. Even though no update will happen (because your local file is identical/newer or has been modified), SW will talk to you if it has problems finding required version information in this thread.

Hi tbone, thank you, your system is working perfectly, great to learn about it, I'll use that for the next one (and just converted jon's GoExisting).
I changed the version to 1.0.1 (I don't think anyone else had downloaded 1.01 so it won't matter.)
Thanks Bruder!