Skip to content

Instantly share code, notes, and snippets.

@adamcameron
Created August 27, 2013 13:16
Show Gist options
  • Save adamcameron/6353377 to your computer and use it in GitHub Desktop.
Save adamcameron/6353377 to your computer and use it in GitHub Desktop.
Showing much tidier to populate an array of structs
l.response.body.result = ArrayNew(1);
for(l.i=1;l.i lte l.events.recordcount;l.i = (l.i + 1)){
arrayAppend(l.response.body["result"], {
"id" = l.events.id;
"start" = DateDiff("s","1/1/1970",l.events.startdate) * 1000;
"end" = DateDiff("s","1/1/1970",l.events.enddate) * 1000;
"title" = l.events.title;
"class" = "class";
"url" = l.url;
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment