Skip to content

Commit

Permalink
fixed TimeSpan.TotalDays
Browse files Browse the repository at this point in the history
  • Loading branch information
Sebastian Loncar committed Jul 22, 2014
1 parent 7d61159 commit 726c663
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Frameworks/JsClr/Internal/Core.js
Original file line number Diff line number Diff line change
Expand Up @@ -2327,7 +2327,7 @@ var System$TimeSpan = {
},
TotalDays$$: "System.Double",
get_TotalDays: function (){
return this.get__ticks() / 86400000;
return this._TotalMilliseconds / 86400000;
},
TotalHours$$: "System.Double",
get_TotalHours: function (){
Expand Down
13 changes: 7 additions & 6 deletions Frameworks/JsClr/System/TimeSpan.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,14 @@ public double TotalDays
{
get
{
return _ticks / MillisPerDay;// 1.1574074074074074E-12;
return _TotalMilliseconds / MillisPerDay;
}
}
public double TotalHours
{
get
{
return _TotalMilliseconds / MillisPerHour;// *2.7777777777777777E-11;
return _TotalMilliseconds / MillisPerHour;
}
}
public double TotalMilliseconds
Expand All @@ -100,14 +100,14 @@ public double TotalMinutes
{
get
{
return _TotalMilliseconds / MillisPerMinute;// _ticks / TicksPerMillisecond.As<double>() / 1000D / 60D; //* 1.6666666666666667E-09;
return _TotalMilliseconds / MillisPerMinute;
}
}
public double TotalSeconds
{
get
{
return _TotalMilliseconds / MillisPerSecond;// 1000;// _ticks * 1E-07;
return _TotalMilliseconds / MillisPerSecond;
}
}

Expand All @@ -118,12 +118,13 @@ public JsImplTimeSpan(long ticks)
{
_TotalMilliseconds = ticks / 10000;
}

public JsImplTimeSpan(int hours, int minutes, int seconds)
{
_TotalMilliseconds = TimeToMs(hours, minutes, seconds);
}
public JsImplTimeSpan(int days, int hours, int minutes, int seconds) : this(days, hours, minutes, seconds, 0)
public JsImplTimeSpan(int days, int hours, int minutes, int seconds)
: this(days, hours, minutes, seconds, 0)
{

}
Expand Down
2 changes: 1 addition & 1 deletion Frameworks/JsClr/res/System.js
Original file line number Diff line number Diff line change
Expand Up @@ -3044,7 +3044,7 @@ var System$TimeSpan = {
},
TotalDays$$: "System.Double",
get_TotalDays: function (){
return this.get__ticks() / 86400000;
return this._TotalMilliseconds / 86400000;
},
TotalHours$$: "System.Double",
get_TotalHours: function (){
Expand Down
2 changes: 1 addition & 1 deletion Frameworks/JsClr/res/jsclr.js
Original file line number Diff line number Diff line change
Expand Up @@ -3128,7 +3128,7 @@ var System$TimeSpan = {
},
TotalDays$$: "System.Double",
get_TotalDays: function (){
return this.get__ticks() / 86400000;
return this._TotalMilliseconds / 86400000;
},
TotalHours$$: "System.Double",
get_TotalHours: function (){
Expand Down
Loading

0 comments on commit 726c663

Please sign in to comment.