--- title: li-datetime-validity description: "Set validity between a start and an end date/time." --- ## Supported Features | Feature | Supported | | ------- | :-------: | | Document | ✗ | | Media | ✔ | | Include | ✗ | | Document Creation Flow | ✗ | | Push Message | ✗ | | Usage Log | ✗ | | Table Dashboard | ✗ | | Display Filter | ✗ | | Search Indexing | ✔ | | System Metadata | ✗ | | Planning System | ✗ | | Webhook Conditions | ✗ | ## Description This plugin allows 'from' and 'to' dates to be defined for a media library entry's validity. An image may have a limited validity, for example due to copyright, so can be used only for a certain period of time. After that period, the copyright expires and the image should be removed from the website. Behind the scenes, since [`release-2024-03`](/operations/releases/release-2024-03/), a job scheduler runs. If a state change is detected then a webhooks event for `mediaLibraryEntry.active` or `mediaLibraryEntry.invalid` will be emitted. Please see the [Webhooks](/reference/webhooks/llms.txt) documentation for further details on how to configure them. If a manual process is used to manage validity, or if you need a way to override the schedule, then [li-invalid](/reference/document/metadata/plugins/li-invalid/llms.txt) can be used. ## Default UI Two datetime inputs ![li-datetime-validity UI](/reference/document/metadata/images/li-datetime-validity-ui.png) ## Storage Format ```js { from: ISO8601 String, to: ISO8601 String } ``` ## Content Type Config ```js { handle: 'myContentType', // ... metadata: [ { handle: 'myHandle', type: 'li-datetime-validity', config: { index: true // optional, default: false. Added in release-2023-07 } } // ... ] } ```