Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F63509412
bfe_updated_date.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Mon, May 20, 15:28
Size
719 B
Mime Type
text/x-python
Expires
Wed, May 22, 15:28 (2 d)
Engine
blob
Format
Raw Data
Handle
17781713
Attached To
R3600 invenio-infoscience
bfe_updated_date.py
View Options
"""BibFormat element - Prints the modified date
"""
from
invenio.search_engine
import
get_modification_date
,
get_creation_date
from
invenio.messages
import
gettext_set_language
def
format_element
(
bfo
,
format
=
'%Y-%m-
%d
'
,
date_format
=
'%Y-%m-
%d
'
):
'''
Get the record modification date.
<b>Note:</b> parameter <code>format</code> is deprecated
@param date_format: The date format in MySQL syntax
'''
_
=
gettext_set_language
(
bfo
.
lang
)
recID
=
bfo
.
recID
return
_
(
"Record created on
%(creation_date)s
, modified on
%(modification_date)s
"
)
%
{
'creation_date'
:
get_creation_date
(
recID
,
"%Y-%m-
%d
"
),
'modification_date'
:
get_modification_date
(
recID
,
"%Y-%m-
%d
"
)}
Event Timeline
Log In to Comment