mirror of https://github.com/tasks/tasks
Remove Format1TaskImporter
parent
34511b83ff
commit
96f390f967
@ -1,66 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2012 Todoroo Inc
|
|
||||||
*
|
|
||||||
* See the file "LICENSE" for the full license governing this code.
|
|
||||||
*/
|
|
||||||
package com.todoroo.astrid.backup;
|
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
|
||||||
import org.slf4j.LoggerFactory;
|
|
||||||
|
|
||||||
import java.text.DateFormat;
|
|
||||||
import java.text.ParseException;
|
|
||||||
import java.text.SimpleDateFormat;
|
|
||||||
import java.util.Date;
|
|
||||||
|
|
||||||
import static org.tasks.date.DateTimeUtils.newDate;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Date Utility functions for backups
|
|
||||||
*
|
|
||||||
* @author Tim Su <tim@todoroo.com>
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class BackupDateUtilities {
|
|
||||||
|
|
||||||
private static final Logger log = LoggerFactory.getLogger(BackupDateUtilities.class);
|
|
||||||
|
|
||||||
private static final String ISO_8601_FORMAT = "yyyy-MM-dd'T'HH:mm:ssz";
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Take an ISO 8601 string and return a Date object.
|
|
||||||
* On failure, returns null.
|
|
||||||
*/
|
|
||||||
public static Date getDateFromIso8601String(String s) {
|
|
||||||
SimpleDateFormat df = new SimpleDateFormat(ISO_8601_FORMAT);
|
|
||||||
try {
|
|
||||||
return df.parse(s);
|
|
||||||
} catch (ParseException e) {
|
|
||||||
log.error(e.getMessage(), e);
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public static Date getTaskDueDateFromIso8601String(String s) {
|
|
||||||
System.err.println("Importing date string: " + s);
|
|
||||||
Date date = getDateFromIso8601String(s);
|
|
||||||
System.err.println("Got date: " + date);
|
|
||||||
if (date != null) {
|
|
||||||
if (date.getHours() == 23 && date.getMinutes() == 59 && date.getSeconds() == 59) {
|
|
||||||
date.setHours(12);
|
|
||||||
date.setMinutes(0);
|
|
||||||
date.setSeconds(0);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return date;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get current date and time as a string. Used for naming backup files.
|
|
||||||
*/
|
|
||||||
public static String getDateForExport() {
|
|
||||||
DateFormat df = new SimpleDateFormat("yyMMdd-HHmm");
|
|
||||||
return df.format(newDate());
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2012 Todoroo Inc
|
|
||||||
*
|
|
||||||
* See the file "LICENSE" for the full license governing this code.
|
|
||||||
*/
|
|
||||||
package com.todoroo.astrid.legacy;
|
|
||||||
|
|
||||||
@SuppressWarnings("unused")
|
|
||||||
public enum LegacyImportance {
|
|
||||||
// MOST IMPORTANT
|
|
||||||
|
|
||||||
LEVEL_1,
|
|
||||||
LEVEL_2,
|
|
||||||
LEVEL_3,
|
|
||||||
LEVEL_4
|
|
||||||
|
|
||||||
// LEAST IMPORTANT
|
|
||||||
}
|
|
||||||
@ -1,56 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2012 Todoroo Inc
|
|
||||||
*
|
|
||||||
* See the file "LICENSE" for the full license governing this code.
|
|
||||||
*/
|
|
||||||
package com.todoroo.astrid.legacy;
|
|
||||||
|
|
||||||
import com.google.ical.values.Frequency;
|
|
||||||
import com.google.ical.values.RRule;
|
|
||||||
|
|
||||||
/** Legacy repeatInfo class */
|
|
||||||
public class LegacyRepeatInfo {
|
|
||||||
/** Legacy repeat interval class */
|
|
||||||
public enum LegacyRepeatInterval {
|
|
||||||
DAYS,
|
|
||||||
WEEKS,
|
|
||||||
MONTHS,
|
|
||||||
HOURS
|
|
||||||
}
|
|
||||||
|
|
||||||
private final LegacyRepeatInterval interval;
|
|
||||||
private final int value;
|
|
||||||
|
|
||||||
public LegacyRepeatInfo(LegacyRepeatInterval repeatInterval, int value) {
|
|
||||||
this.interval = repeatInterval;
|
|
||||||
this.value = value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public LegacyRepeatInterval getInterval() {
|
|
||||||
return interval;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getValue() {
|
|
||||||
return value;
|
|
||||||
}
|
|
||||||
|
|
||||||
public RRule toRRule() {
|
|
||||||
RRule rrule = new RRule();
|
|
||||||
rrule.setInterval(getValue());
|
|
||||||
switch(getInterval()) {
|
|
||||||
case DAYS:
|
|
||||||
rrule.setFreq(Frequency.DAILY);
|
|
||||||
break;
|
|
||||||
case WEEKS:
|
|
||||||
rrule.setFreq(Frequency.WEEKLY);
|
|
||||||
break;
|
|
||||||
case MONTHS:
|
|
||||||
rrule.setFreq(Frequency.MONTHLY);
|
|
||||||
break;
|
|
||||||
case HOURS:
|
|
||||||
rrule.setFreq(Frequency.HOURLY);
|
|
||||||
}
|
|
||||||
return rrule;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@ -1,34 +0,0 @@
|
|||||||
/**
|
|
||||||
* Copyright (c) 2012 Todoroo Inc
|
|
||||||
*
|
|
||||||
* See the file "LICENSE" for the full license governing this code.
|
|
||||||
*/
|
|
||||||
package com.todoroo.astrid.legacy;
|
|
||||||
|
|
||||||
/** Legacy task class */
|
|
||||||
abstract public class LegacyTaskModel {
|
|
||||||
|
|
||||||
public static final String ID = "_id";
|
|
||||||
public static final String NAME = "name";
|
|
||||||
public static final String NOTES = "notes";
|
|
||||||
public static final String PROGRESS_PERCENTAGE = "progressPercentage";
|
|
||||||
public static final String IMPORTANCE = "importance";
|
|
||||||
public static final String ESTIMATED_SECONDS = "estimatedSeconds";
|
|
||||||
public static final String ELAPSED_SECONDS = "elapsedSeconds";
|
|
||||||
public static final String TIMER_START = "timerStart";
|
|
||||||
public static final String DEFINITE_DUE_DATE = "definiteDueDate";
|
|
||||||
public static final String PREFERRED_DUE_DATE = "preferredDueDate";
|
|
||||||
public static final String HIDDEN_UNTIL = "hiddenUntil";
|
|
||||||
public static final String POSTPONE_COUNT = "postponeCount";
|
|
||||||
public static final String NOTIFICATIONS = "notifications";
|
|
||||||
public static final String NOTIFICATION_FLAGS = "notificationFlags";
|
|
||||||
public static final String LAST_NOTIFIED = "lastNotified";
|
|
||||||
public static final String CREATION_DATE = "creationDate";
|
|
||||||
public static final String COMPLETION_DATE = "completionDate";
|
|
||||||
public static final String FLAGS = "flags";
|
|
||||||
public static final String BLOCKING_ON = "blockingOn";
|
|
||||||
|
|
||||||
// other flags
|
|
||||||
public static final int FLAG_SYNC_ON_COMPLETE = 1;
|
|
||||||
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue