Jump to content
Wiki Home
EPrints Home
Bazaar
Files
Main menu
Main menu
move to sidebar
hide
Navigation
Front Page
EPrints 3 Manual
EPrints Training Course
EPrints Glossary
Installing EPrints
How-to Configure EPrints
EPrints 3.2+ API
EPrints 3 Reference
EPrints Plugins
Wiki
All categories
Recent changes
Main Page
Help
EPrints Documentation
Search
Search
Appearance
Log in
Request account
Personal tools
Log in
Request account
Pages for logged out editors
learn more
Contributions
Talk
Editing
Date field
Page
Discussion
British English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
{{fieldtypes}} == Description == This field is used to store a single date. Internally EPrints always uses ISO standard notation for dates, it avoids confusion. This is <tt>YYYY-MM-DD</tt>. In bibliographies sometimes exact dates of publication (or other events) are not known. EPrints allows you to store month and year values in date fields. <tt>YYYY</tt> or <tt>YYYY-MM</tt>. In the database EPrints actually uses 3 integer fields to store the date, rather than a built in date field. This is because of the need to allow <tt>NULL</tt> in month and day if the date is just <tt>1998</tt>. == Inheritance == * [[Metadata]] ** [[Date field]] == Additional Properties == {| border="1" cellpadding="3" cellspacing="0" ! Name !! Default Value !! Required !! Description !! Notes |- | '''input_style''' || <tt>long</tt> || NO || Whether to render the date inpit fields using longer or shorter month labels. || Can be <tt>short</tt> or <tt>long</tt>. The former is useful if you have limited width in your input form, especially if you are using a date field in a [[Compound field]]. |- | '''min_resolution''' || <tt>day</tt> || NO || The minimum resoltion of date that must be entered. Can be <tt>day</tt>, <tt>month</tt> or <tt>year</tt>. || If set to <tt>day</tt> then values of <tt>YYYY</tt> or <tt>YYYY-MM</tt> will cause a validation error. If set to <tt>month</tt> then values of <tt>YYYY</tt> will cause a validation error. If set to <tt>year</tt> then day, month or year resolutions are allowed. |- | '''render_res''' || <tt>day</tt> || NO || The resolution to render the date stored by this field. Can be <tt>day</tt>, <tt>month</tt> or <tt>year</tt>. || If set to <tt>year</tt> then the dates <tt>1998-10-01</tt>, <tt>1998-10</tt> and <tt>1998</tt> would all be rendered as <tt>1998</tt>. This is not too useful in configuring the field, but can be set as a print option inside citation files. |- | '''render_style''' || <tt>long</tt> || NO || The resolution to render the date stored by this field. Can be <tt>short</tt>, <tt>long</tt> or<tt>dow</tt>. || If <tt>long</tt> then you'll see <tt>8 September 1998</tt>. If <tt>short</tt> then <tt>08 Sep 1998</tt>. <tt>dow</tt> would render <tt>Tuesday 8 September 1998</tt>. |} == Required Phrases == No additional phrases beyond the [[Metadata#Required_Phrases|standard metadata field phrases]]. == Database == Date fields are stored in the database as: fieldname_year SMALLINT(6) fieldname_month SMALLINT(6) fieldname_day SMALLINT(6) If a date only has a year value then it would be stored as 1998,NULL,NULL == API == See [[API:EPrints/MetaField/Date|API page]]. Date values are represented in the API as scalars containing ISO encoded dates. eg. "1976" "1976-02" "1976-02-02" === Searching === Date fields can be searched as either single values or ranges. Searching for <tt>2006><tt> will also match <tt>2006-12-25</tt>. You can search for <tt>2000-</tt> to search dates in or after 2000. Or <tt>2000-12-2003-01</tt> for December 2000 through January 2003. == Examples == Most basic example. { name => 'acceptance_date', type => 'date', } Set minimum resolution to which the date must be specified is at least a <tt>month</tt>. { name => 'moratorium_date', type => 'date', min_resolution => 'month', } Set resolution to render to the <tt>month</tt>, set rendering style to <tt>short</tt> (e.g. Feb 2023). { name => 'publication_date', type => 'date', render_res => 'month', render_style => short', }
Summary:
Please note that all contributions to EPrints Documentation may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
EPrints Documentation:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Templates used on this page:
Template:Fieldtypes
(
edit
)
Template:RefLinks
(
edit
)