This commit is contained in:
@@ -234,3 +234,15 @@ https://en.wikipedia.org/wiki/Non-functional_requirement
|
|||||||
|
|
||||||
## ASCII ART
|
## ASCII ART
|
||||||
//http://www.patorjk.com/software/taag/#p=display&f=ANSI%20Shadow&t=PM
|
//http://www.patorjk.com/software/taag/#p=display&f=ANSI%20Shadow&t=PM
|
||||||
|
|
||||||
|
## Time zone stuff
|
||||||
|
//play with any time zone with codes
|
||||||
|
http://www.timezoneconverter.com/cgi-bin/zoneinfo
|
||||||
|
|
||||||
|
//list of time zone offsets
|
||||||
|
https://en.wikipedia.org/wiki/List_of_UTC_time_offsets
|
||||||
|
|
||||||
|
Good test time zones:
|
||||||
|
America/St_Johns - because it has a fractional hour difference
|
||||||
|
America/New_York
|
||||||
|
America/Los_Angeles
|
||||||
|
|||||||
@@ -86,18 +86,18 @@ namespace AyaNova.Api.Controllers
|
|||||||
s.Id = v.WoItemSchedUserId;
|
s.Id = v.WoItemSchedUserId;
|
||||||
s.Color = ColorFromWOItem(v, p);
|
s.Color = ColorFromWOItem(v, p);
|
||||||
s.TextColor = TextColor(s.Color);
|
s.TextColor = TextColor(s.Color);
|
||||||
s.Start = EpochSeconds(v.StartDate);
|
s.Start = EpochSeconds(v.StartDate, p.TZOffset);
|
||||||
s.End = EpochSeconds(v.StopDate);
|
s.End = EpochSeconds(v.StopDate, p.TZOffset);
|
||||||
s.Type = AyaType.WorkOrderItemScheduledUser;
|
s.Type = AyaType.WorkOrderItemScheduledUser;
|
||||||
s.Name = NameFromWOItem(v, p);
|
s.Name = NameFromWOItem(v, p);
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static long? EpochSeconds(DateTime? dt)
|
private static long? EpochSeconds(DateTime? dt, int tzOffset = 0)
|
||||||
{
|
{
|
||||||
if (dt == null) return null;
|
if (dt == null) return null;
|
||||||
DateTimeOffset dto = new DateTimeOffset((DateTime)dt);
|
DateTimeOffset dto = new DateTimeOffset((DateTime)dt);
|
||||||
return dto.ToUnixTimeMilliseconds();
|
return dto.ToUnixTimeMilliseconds() + (tzOffset * 60000);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static string ColorFromWOItem(ViewSchedulePersonalWorkOrder v, PersonalScheduleParams p)
|
private static string ColorFromWOItem(ViewSchedulePersonalWorkOrder v, PersonalScheduleParams p)
|
||||||
@@ -151,6 +151,7 @@ namespace AyaNova.Api.Controllers
|
|||||||
public class PersonalScheduleParams
|
public class PersonalScheduleParams
|
||||||
{
|
{
|
||||||
public ScheduleView View { get; set; }
|
public ScheduleView View { get; set; }
|
||||||
|
public int TZOffset { get; set; }
|
||||||
public DateTime Start { get; set; }
|
public DateTime Start { get; set; }
|
||||||
public DateTime End { get; set; }
|
public DateTime End { get; set; }
|
||||||
public PersonalScheduleWorkOrderColorSource ColorSource { get; set; }
|
public PersonalScheduleWorkOrderColorSource ColorSource { get; set; }
|
||||||
|
|||||||
Reference in New Issue
Block a user