Skip to content
This repository has been archived by the owner on Nov 5, 2022. It is now read-only.

Commit

Permalink
Fixed timezone issue
Browse files Browse the repository at this point in the history
  • Loading branch information
alsutton committed Sep 30, 2011
1 parent d2621d4 commit 4d36a48
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 27 deletions.
40 changes: 20 additions & 20 deletions android-app/res/xml/blocks.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,62 +18,62 @@

<!-- Thursday, October 6th 2011 -->
<block>
<start>2011-10-06T09:00:00.000-00:00</start>
<end>2011-10-06T17:00:00.000-00:00</end>
<start>2011-10-06T09:00:00.000+01:00</start>
<end>2011-10-06T17:00:00.000+01:00</end>
<title>On-site check-in</title>
</block>
<block>
<start>2011-10-06T09:00:00.000-00:00</start>
<end>2011-10-06T17:30:00.000-00:00</end>
<start>2011-10-06T09:00:00.000+01:00</start>
<end>2011-10-06T17:30:00.000+01:00</end>
<title>BarCamp</title>
<type>session</type>
</block>
<block>
<start>2011-10-06T17:30:00.000-00:00</start>
<end>2011-10-06T19:30:00.000-00:00</end>
<start>2011-10-06T17:30:00.000+01:00</start>
<end>2011-10-06T19:30:00.000+01:00</end>
<title>DemoCamp</title>
<type>session</type>
</block>
<block>
<start>2011-10-06T19:30:00.000-00:00</start>
<end>2011-10-06T22:30:00.000-00:00</end>
<start>2011-10-06T19:30:00.000+01:00</start>
<end>2011-10-06T22:30:00.000+01:00</end>
<title>After Hours Party</title>
<type>food</type>
</block>

<!-- Friday, October 7th 2011 -->
<block>
<start>2011-10-07T08:00:00.000-00:00</start>
<end>2011-10-07T17:00:00.000-00:00</end>
<start>2011-10-07T08:00:00.000+01:00</start>
<end>2011-10-07T17:00:00.000+01:00</end>
<title>On-site check-in</title>
</block>
<block>
<start>2011-10-07T09:00:00.000-00:00</start>
<end>2011-10-07T09:05:00.000-00:00</end>
<start>2011-10-07T09:00:00.000+01:00</start>
<end>2011-10-07T09:05:00.000+01:00</end>
<title>Conference kick-off</title>
<type>session</type>
</block>
<block>
<start>2011-10-07T11:35:00.000-00:00</start>
<end>2011-10-07T11:50:00.000-00:00</end>
<start>2011-10-07T11:35:00.000+01:00</start>
<end>2011-10-07T11:50:00.000+01:00</end>
<title>Coffee break</title>
<type>food</type>
</block>
<block>
<start>2011-10-07T13:10:00.000-00:00</start>
<end>2011-10-07T14:10:00.000-00:00</end>
<start>2011-10-07T13:10:00.000+01:00</start>
<end>2011-10-07T14:10:00.000+01:00</end>
<title>Lunch served</title>
<type>food</type>
</block>
<block>
<start>2011-10-07T15:10:00.000-00:00</start>
<end>2011-10-07T15:30:00.000-00:00</end>
<start>2011-10-07T15:10:00.000+01:00</start>
<end>2011-10-07T15:30:00.000+01:00</end>
<title>Coffee break</title>
<type>food</type>
</block>
<block>
<start>2011-10-07T17:45:00.000-00:00</start>
<end>2011-10-07T18:15:00.000-00:00</end>
<start>2011-10-07T17:45:00.000+01:00</start>
<end>2011-10-07T18:15:00.000+01:00</end>
<title>Closing Keynote</title>
<type>session</type>
</block>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import android.content.ContentResolver;
import android.database.Cursor;
import android.net.Uri;
import android.util.Log;

import java.io.IOException;
import java.util.ArrayList;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public class RemoteSessionsHandler extends XmlHandler {
* {@link Columns#SESSION_DATE} and {@link Columns#SESSION_TIME}.
*/
private static final SimpleDateFormat sTimeFormat = new SimpleDateFormat(
"EEEE MMM d yyyy h:mma Z", Locale.US);
"EEEE MMM d yyyy h:mma Z", Locale.UK);

public RemoteSessionsHandler() {
super(ScheduleContract.CONTENT_AUTHORITY);
Expand Down Expand Up @@ -189,7 +189,7 @@ public ArrayList<ContentProviderOperation> parse(XmlPullParser parser, ContentRe
* {@link Columns#SESSION_TIME}.
*/
private static long parseTime(String date, String time) throws HandlerException {
final String composed = String.format("%s 2011 %s -0000", date, time);
final String composed = String.format("%s 2011 %s +0100", date, time);
try {
return sTimeFormat.parse(composed).getTime();
} catch (java.text.ParseException e) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ public Uri insert(Uri uri, ContentValues values) {
getContext().getContentResolver().notifyChange(uri, null);
return Tracks.buildTrackUri(values.getAsString(SessionsTracks.TRACK_ID));
}
case SPEAKERS: {
case SPEAKERS: {
db.insertOrThrow(Tables.SPEAKERS, null, values);
getContext().getContentResolver().notifyChange(uri, null);
return Speakers.buildSpeakerUri(values.getAsString(Speakers.SPEAKER_ID));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ public class ScheduleFragment extends Fragment implements
private static final int TIME_FLAGS = DateUtils.FORMAT_SHOW_DATE
| DateUtils.FORMAT_SHOW_WEEKDAY | DateUtils.FORMAT_ABBREV_WEEKDAY;

private static final long TUE_START = ParserUtils.parseTime("2011-10-06T00:00:00.000-00:00");
private static final long WED_START = ParserUtils.parseTime("2011-10-07T00:00:00.000-00:00");
private static final long TUE_START = ParserUtils.parseTime("2011-10-06T00:00:00.000+01:00");
private static final long WED_START = ParserUtils.parseTime("2011-10-07T00:00:00.000+01:00");

private static final int DISABLED_BLOCK_ALPHA = 100;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ public class UIUtils {
public static final TimeZone CONFERENCE_TIME_ZONE = TimeZone.getTimeZone("Europe/London");

public static final long CONFERENCE_START_MILLIS = ParserUtils.parseTime(
"2011-10-06T09:00:00.000-00:00");
"2011-10-06T09:00:00.000+01:00");
public static final long CONFERENCE_END_MILLIS = ParserUtils.parseTime(
"2011-10-07T17:30:00.000-00:00");
"2011-10-07T17:30:00.000+01:00");

public static final Uri CONFERENCE_URL = Uri.parse("http://www.droidcon.co.uk/");

Expand Down

0 comments on commit 4d36a48

Please sign in to comment.