Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: samples/swarm/DataSource.dart

Issue 11770004: Rename Date to DateTime. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address comments and keep Backwards-compatibility class Date. Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « samples/solar3d/web/solar.dart ('k') | samples/swarm/swarm_ui_lib/base/AnimationScheduler.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of swarmlib; 5 part of swarmlib;
6 6
7 /** The top-level collection of all sections for a user. */ 7 /** The top-level collection of all sections for a user. */
8 // TODO(jimhug): This is known as UserData in the server model. 8 // TODO(jimhug): This is known as UserData in the server model.
9 class Sections extends Collection<Section> { 9 class Sections extends Collection<Section> {
10 final List<Section> _sections; 10 final List<Section> _sections;
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 return CollectionUtils.find(articles, (article) => article.id == id_); 161 return CollectionUtils.find(articles, (article) => article.id == id_);
162 } 162 }
163 163
164 void refresh() {} 164 void refresh() {}
165 } 165 }
166 166
167 167
168 /** A single article or posting to display. */ 168 /** A single article or posting to display. */
169 class Article { 169 class Article {
170 final String id; 170 final String id;
171 Date date; 171 DateTime date;
172 final String title; 172 final String title;
173 final String author; 173 final String author;
174 final bool hasThumbnail; 174 final bool hasThumbnail;
175 String textBody; // TODO(jimhug): rename to snipppet. 175 String textBody; // TODO(jimhug): rename to snipppet.
176 final Feed dataSource; // TODO(jimhug): rename to feed. 176 final Feed dataSource; // TODO(jimhug): rename to feed.
177 String _htmlBody; 177 String _htmlBody;
178 String srcUrl; 178 String srcUrl;
179 final ObservableValue<bool> unread; // TODO(jimhug): persist to server. 179 final ObservableValue<bool> unread; // TODO(jimhug): persist to server.
180 180
181 bool error; // TODO(jimhug): Check if this is dead and remove. 181 bool error; // TODO(jimhug): Check if this is dead and remove.
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
230 230
231 static Article decodeHeader(Feed source, Decoder decoder) { 231 static Article decodeHeader(Feed source, Decoder decoder) {
232 final id = decoder.readString(); 232 final id = decoder.readString();
233 final title = decoder.readString(); 233 final title = decoder.readString();
234 final srcUrl = decoder.readString(); 234 final srcUrl = decoder.readString();
235 final hasThumbnail = decoder.readBool(); 235 final hasThumbnail = decoder.readBool();
236 final author = decoder.readString(); 236 final author = decoder.readString();
237 final dateInSeconds = decoder.readInt(); 237 final dateInSeconds = decoder.readInt();
238 final snippet = decoder.readString(); 238 final snippet = decoder.readString();
239 final date = 239 final date =
240 new Date.fromMillisecondsSinceEpoch(dateInSeconds*1000, isUtc: true); 240 new DateTime.fromMillisecondsSinceEpoch(dateInSeconds*1000, isUtc: true) ;
241 return new Article(source, id, date, title, author, srcUrl, hasThumbnail, 241 return new Article(source, id, date, title, author, srcUrl, hasThumbnail,
242 snippet); 242 snippet);
243 } 243 }
244 } 244 }
OLDNEW
« no previous file with comments | « samples/solar3d/web/solar.dart ('k') | samples/swarm/swarm_ui_lib/base/AnimationScheduler.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698