Temporary fix to retain special date handling for filingDate even though it's been unmapped from Date base field

This commit is contained in:
Dan Stillman 2010-01-26 09:51:53 +00:00
parent ac31012da7
commit 936142b131
2 changed files with 9 additions and 4 deletions

View file

@ -417,7 +417,9 @@
if (fieldIsClickable
&& !Zotero.Items.isPrimaryField(fieldName)
&& Zotero.ItemFields.isFieldOfBase(Zotero.ItemFields.getID(fieldName), 'date')
&& (Zotero.ItemFields.isFieldOfBase(Zotero.ItemFields.getID(fieldName), 'date')
// TEMP - filingDate
|| fieldName == 'filingDate')
// TEMP - NSF
&& fieldName != 'dateSent') {
this.addDateRow(fieldNames[i], this.item.getField(fieldName, true), tabindex);
@ -1269,7 +1271,8 @@
if (fieldID) {
// Display the SQL date as a tooltip for date fields
if (Zotero.ItemFields.isFieldOfBase(fieldID, 'date')) {
// TEMP - filingDate
if (Zotero.ItemFields.isFieldOfBase(fieldID, 'date') || fieldName == 'filingDate') {
valueElement.setAttribute('tooltiptext',
Zotero.Date.multipartToSQL(this.item.getField(fieldName, true)));
}

View file

@ -211,7 +211,8 @@ Zotero.Item.prototype.getField = function(field, unformatted, includeBaseMapped)
if (!unformatted) {
// Multipart date fields
if (Zotero.ItemFields.isFieldOfBase(fieldID, 'date')) {
// TEMP - filingDate
if (Zotero.ItemFields.isFieldOfBase(fieldID, 'date') || field == 'filingDate') {
value = Zotero.Date.multipartToStr(value);
}
}
@ -753,7 +754,8 @@ Zotero.Item.prototype.setField = function(field, value, loadIn) {
if (!loadIn) {
// Save date field as multipart date
if (Zotero.ItemFields.isFieldOfBase(fieldID, 'date') &&
// TEMP - filingDate
if ((Zotero.ItemFields.isFieldOfBase(fieldID, 'date') || field == 'filingDate') &&
!Zotero.Date.isMultipart(value)) {
value = Zotero.Date.strToMultipart(value);
}