One of the main features of the EVE Online Market view is filtering history by a date range, allowing the player to see trends over 1 year, 6 months, 3 months, and the last 7 days.
Luckily all entries in the history come with a date time string, which can be parsed directly to a .NET DateTime object. Compare this with a date from six months ago and we can filter the results.
DateTime cutOffDate = DateTime.Today.AddMonths(-6);
foreach (Item _item in hist.items) {
// Grab the date from the history entry and compare against the cutoff date
DateTime _date = DateTime.Parse(_item.date);
if (_date >= cutOffDate) {
// Add the history
}
}
Making use of the new Dropdown UI element in Unity 5.3, the date range can be set directly from the UI event callback.
It is important to remember each entry in the history is a daily average, high, and low price of the specified item. In time, data about current buy/sell orders will be polled. It is this data that should benefit from the CREST API.
Links in this post
- MSDN DateTime - Represents an instant in time, typically expressed as a date and time of day