Top Description Fields Constructors Methods
org.jabref.logic.cleanup

public Class TimeStampToModificationDate

extends Object
implements CleanupJob
Class Inheritance
All Implemented Interfaces
org.jabref.logic.cleanup.CleanupJob
Imports
java.time.LocalDateTime, java.time.format.DateTimeFormatter, java.time.temporal.ChronoUnit, java.util.ArrayList, .Collections, .List, .Optional, org.jabref.logic.preferences.TimestampPreferences, org.jabref.model.FieldChange, org.jabref.model.entry.BibEntry, .Date, org.jabref.model.entry.event.EntriesEventSource, org.jabref.model.entry.field.Field, .StandardField

This class handles the migration from timestamp field to creationdate and modificationdate fields.

If the old updateTimestamp setting is enabled, the timestamp field for each entry are migrated to the date-modified field. Otherwise it is migrated to the date-added field.

Field Summary

Modifier and TypeField and Description
private final Field

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public List<FieldChange>
cleanup(BibEntry entry)

Implements org.jabref.logic.cleanup.CleanupJob.cleanup.

Cleanup the entry.

private Optional<String>
formatTimeStamp(String timeStamp)

Formats the time stamp into the local date and time format.

private int
getMonth(Date date)

Returns the month value of the passed date if available.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

timeStampFieldback to summary
private final Field timeStampField

Constructor Detail

TimeStampToModificationDateback to summary
public TimeStampToModificationDate(TimestampPreferences timestampPreferences)

Method Detail

cleanupback to summary
public List<FieldChange> cleanup(BibEntry entry)

Implements org.jabref.logic.cleanup.CleanupJob.cleanup.

Doc from org.jabref.logic.cleanup.CleanupJob.cleanup.

Cleanup the entry.

Annotations
@Override
formatTimeStampback to summary
private Optional<String> formatTimeStamp(String timeStamp)

Formats the time stamp into the local date and time format. If the existing timestamp could not be parsed, the day/month/year "1" is used. For the time portion 00:00:00 is used.

getMonthback to summary
private int getMonth(Date date)

Returns the month value of the passed date if available. Otherwise returns the current month.