Skip to content

Instantly share code, notes, and snippets.

@pjsvis
Last active August 29, 2015 14:16
Show Gist options
  • Select an option

  • Save pjsvis/cb9c7e0cb5bca362e00e to your computer and use it in GitHub Desktop.

Select an option

Save pjsvis/cb9c7e0cb5bca362e00e to your computer and use it in GitHub Desktop.
// Format as per flot requirements
var flotData = new[]
{
new {label = "Quantity Required", data = partAvailability.Select(x => new[] {x.TimeStamp, x.QuantityRequired})},
new {label = "Quantity Available", data = partAvailability.Select(x => new[] {x.TimeStamp, x.QuantityAvailable})}
};
// Timestamp created as follows
private static long GetJavascriptTimestamp(DateTime date)
{
return (long)date.Subtract(new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc)).TotalMilliseconds;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment