Skip to content

Commit

Permalink
Added info for day of week, a little documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
martinothamar committed Jun 17, 2015
1 parent 3bb0fe0 commit 2886a2d
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
7 changes: 4 additions & 3 deletions ScheduleGrabber/Grabber.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ static void Main(string[] args)
var options = new OptionSet()
.Add("h|help", "show this message and exit", v => show_help = v != null)
.Add("f|file=", "write JSON to specified file", input => file = input)
.Add("i|id=", "write only the specified ID to JSON file", input => id = input);
.Add("i|id=", "write only the schedule data related to a specific department ID to JSON file", input => id = input);

try
{
Expand Down Expand Up @@ -111,8 +111,9 @@ static void Main(string[] args)
static void ShowHelp(OptionSet options)
{
Console.WriteLine("Usage: ScheduleGrabber [OPTIONS]");
Console.WriteLine("Write UiA schedule data to JSON");
Console.WriteLine("If no flags are given, departments.json is generated.");
Console.WriteLine("Write UiA schedule data to JSON.");
Console.WriteLine("If no flags are given, departments.json is generated\n" +
"from the schedule data of all departments.");
Console.WriteLine();
Console.WriteLine("Options:");
options.WriteOptionDescriptions(Console.Out);
Expand Down
1 change: 1 addition & 0 deletions ScheduleGrabber/Objects/Day.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ namespace ScheduleGrabber.Objects
public class Day
{
public DateTime Date { get; set; }
public string DayOfWeek { get; set; }
public List<Activity> Activities { get; set; }

public Day()
Expand Down
1 change: 1 addition & 0 deletions ScheduleGrabber/Objects/Department.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ public void GrabSchedule(PostData requestData)
Day aday = new Day();
aday.Activities.Add(activity);
aday.Date = new DateTime(activity.Start.Year, activity.Start.Month, activity.Start.Day);
aday.DayOfWeek = aday.Date.DayOfWeek.ToString();
dayList.Add(aday);
}
else if (currentDate.Count() == 1)
Expand Down

0 comments on commit 2886a2d

Please sign in to comment.