@@ -270,6 +270,14 @@ function saveFeed(data, callback) {
270
270
} ;
271
271
272
272
273
+ function fixDate ( d ) {
274
+ if ( d ) {
275
+ d = d . toString ( ) . substr ( 4 , 6 ) + ', ' + d . toString ( ) . substr ( 11 , 4 ) ;
276
+ }
277
+ return d ;
278
+ }
279
+
280
+
273
281
function getBookmarkedChallenges ( ids , callback ) {
274
282
var results = [ ] ;
275
283
@@ -285,7 +293,33 @@ function getBookmarkedChallenges(ids, callback) {
285
293
return callback ( err ) ;
286
294
} else {
287
295
console . log ( challenge ) ;
288
- results . push ( challenge ) ;
296
+
297
+ if ( challenge . posted_date )
298
+ challenge . posted_date = challenge . posted_date . toString ( ) . substr ( 4 , 11 ) ;
299
+
300
+ if ( challenge . submission_period_start_date )
301
+ challenge . submission_period_start_date = challenge . submission_period_start_date . toString ( ) . substr ( 4 , 11 ) ;
302
+
303
+ // HACK until v1.1
304
+ if ( challenge . submission_period_end_date )
305
+ challenge . submission_period_end_date = fixDate ( challenge . submission_period_end_date . toString ( ) ) ;
306
+
307
+ if ( challenge . judging_period_start_date )
308
+ challenge . judging_period_start_date = challenge . judging_period_start_date . toString ( ) . substr ( 4 , 11 ) ;
309
+
310
+ if ( challenge . judging_period_end_date )
311
+ challenge . judging_period_end_date = challenge . judging_period_end_date . toString ( ) . substr ( 4 , 11 ) ;
312
+
313
+ if ( challenge . public_voting_period_start_date )
314
+ challenge . public_voting_period_start_date = challenge . public_voting_period_start_date . toString ( ) . substr ( 4 , 11 ) ;
315
+
316
+ if ( challenge . public_voting_period_end_date )
317
+ challenge . public_voting_period_end_date = challenge . public_voting_period_end_date . toString ( ) . substr ( 4 , 11 ) ;
318
+
319
+ if ( challenge . winners_announced_date )
320
+ challenge . winners_announced_date = challenge . winners_announced_date . toString ( ) . substr ( 4 , 11 ) ;
321
+
322
+ results . push ( challenge ) ;
289
323
290
324
count -- ;
291
325
if ( ! count ) {
0 commit comments