Copy link to clipboard
Copied
I have been using the SDK information, and have successfully added custom data fields using data type = String and enum
I would like to add a date field that will display as a date in the Library search field.
I have been using just a string to hold the date, but it is treated as text in search.
Is there a data type when defining your fields for a date / time?
Is this just a matter of formatting?
Your help is appreciated.
The SDK allows just three types: "string", "enum", and "URL". It doesn't provide any mechanism for controlling how they are displayed. So if how the value is displayed is important, you'll need to store string values in the format you want users to see them. There have been requests for years to expand the metadata capabilities of plugins:
Plugs do have one minor way to control the d
...Copy link to clipboard
Copied
The SDK allows just three types: "string", "enum", and "URL". It doesn't provide any mechanism for controlling how they are displayed. So if how the value is displayed is important, you'll need to store string values in the format you want users to see them. There have been requests for years to expand the metadata capabilities of plugins:
Plugs do have one minor way to control the display of custom metadata fields in tagsets -- they can tell LR to use multiple lines for displaying string values and allow newlines on input:
{'com.adobe.caption', height_in_lines = 15, allow_newlines = true, topLabel = true}
(I assume you've read Chapter 4 of the Lightroom Classic Programmers Guide.)
Copy link to clipboard
Copied
My main focus is being able to create a date field for 2 reasons:
1. Be able to use the field or fields for date calculations
2. Be able to search with the date hierarchy versus just a flat query like text fields.
I believe I can parse the info to do calculations from the text field, but was hoping for something easier.
And yes I have been through the manual, as well as other lua resources.
Copy link to clipboard
Copied
In some of my plugins, I've created two fields, once that's hidden and in a format that's easy to parse, and one that's visible and nicely formatted for display to users.
[Use the blue reply button under the first post to ensure replies sort properly.]