Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ public class Direction {

private CharSequence newTime = null;

private CharSequence shortTime;

private boolean isTransit = false;

private ArrayList<Direction> subDirections = null;
Expand Down Expand Up @@ -176,4 +178,12 @@ public CharSequence getExtra() {
public void setExtra(CharSequence extra) {
this.extra = extra;
}

public CharSequence getShortTime() {
return shortTime;
}

public void setShortTime(CharSequence shortTime) {
this.shortTime = shortTime;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,18 @@ public static List<Itinerary> fixTimezoneOffsets(List<Itinerary> itineraries,
}
}

public static String getShortFormattedTime(Context context, int offsetGMT, long time) {
DateFormat timeFormat = android.text.format.DateFormat.getTimeFormat(context);
timeFormat.setTimeZone(TimeZone.getTimeZone("GMT"));
Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
cal.setTimeInMillis(time);
cal.add(Calendar.MILLISECOND, offsetGMT);
if (cal.get(Calendar.SECOND) >= 30) {
cal.add(Calendar.MINUTE, 1);
}
return timeFormat.format(cal.getTime());
}

public static CharSequence getTimeWithContext(Context applicationContext, int offsetGMT, long time,
boolean inLine) {
return getTimeWithContext(applicationContext, offsetGMT, time, inLine, -1);
Expand Down
Loading
Loading