Feature #35: Livestamp implemented
Humanized dates now update automatically when a page is left open for some time.
This commit is contained in:
@@ -17,28 +17,8 @@ namespace Disco.Web.Areas.API.Models.Attachment
|
||||
public string Comments { get; set; }
|
||||
public string Filename { get; set; }
|
||||
public string MimeType { get; set; }
|
||||
public string TimestampFuzzy
|
||||
{
|
||||
get
|
||||
{
|
||||
return Timestamp.FromNow();
|
||||
}
|
||||
set
|
||||
{
|
||||
// Ignore
|
||||
}
|
||||
}
|
||||
public string TimestampFull
|
||||
{
|
||||
get
|
||||
{
|
||||
return Timestamp.ToFullDateTime();
|
||||
}
|
||||
set
|
||||
{
|
||||
// Ignore
|
||||
}
|
||||
}
|
||||
public long TimestampUnixEpoc { get { return Timestamp.ToUnixEpoc(); } }
|
||||
public string TimestampFull { get { return Timestamp.ToFullDateTime(); } }
|
||||
|
||||
public static _AttachmentModel FromAttachment(Disco.Models.Repository.UserAttachment ua)
|
||||
{
|
||||
|
||||
@@ -9,6 +9,6 @@ namespace Disco.Web.Areas.API.Models.DocumentTemplate
|
||||
{
|
||||
public string Id { get; set; }
|
||||
public string Timestamp { get; set; }
|
||||
public string TimestampFuzzy { get; set; }
|
||||
public long TimestampUnixEpoc { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -15,28 +15,8 @@ namespace Disco.Web.Areas.API.Models.Job
|
||||
public string Author { get; set; }
|
||||
public DateTime Timestamp { get; set; }
|
||||
public string Comments { get; set; }
|
||||
public string TimestampFuzzy
|
||||
{
|
||||
get
|
||||
{
|
||||
return Timestamp.FromNow();
|
||||
}
|
||||
set
|
||||
{
|
||||
// Ignore
|
||||
}
|
||||
}
|
||||
public string TimestampFull
|
||||
{
|
||||
get
|
||||
{
|
||||
return Timestamp.ToFullDateTime();
|
||||
}
|
||||
set
|
||||
{
|
||||
// Ignore
|
||||
}
|
||||
}
|
||||
public long TimestampUnixEpoc { get { return this.Timestamp.ToUnixEpoc(); } }
|
||||
public string TimestampFull { get { return Timestamp.ToFullDateTime(); } }
|
||||
|
||||
public static _CommentModel FromJobLog(Disco.Models.Repository.JobLog jl)
|
||||
{
|
||||
|
||||
@@ -13,14 +13,14 @@ namespace Disco.Web.Areas.API.Models.Job
|
||||
public string UserDescription { get; set; }
|
||||
public string DateTimeFull { get; set; }
|
||||
public string DateTimeFriendly { get; set; }
|
||||
public string DateTimeJavascript { get; set; }
|
||||
public long DateTimeSortable { get; set; }
|
||||
public string DateTimeISO8601 { get; set; }
|
||||
public long DateTimeUnixEpoc { get; set; }
|
||||
|
||||
public _DateChangeModel SetDateTime(DateTime? date)
|
||||
{
|
||||
this.DateTimeFriendly = date.FromNow(null);
|
||||
this.DateTimeJavascript = date.ToJavaScript();
|
||||
this.DateTimeSortable = date.ToSortable();
|
||||
this.DateTimeISO8601 = date.ToISO8601();
|
||||
this.DateTimeUnixEpoc = date.ToUnixEpoc() ?? -1;
|
||||
this.DateTimeFull = date.ToFullDateTime(null);
|
||||
|
||||
return this;
|
||||
|
||||
Reference in New Issue
Block a user