We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Learn more about funding links in repositories.
Report abuse
1 parent c723073 commit 33264fbCopy full SHA for 33264fb
corelib/time.rb
@@ -90,11 +90,24 @@ def self.parse(str)
90
end
91
92
def +(other)
93
- Time.allocate(self.to_f + other.to_f)
+ %x{
94
+ if (other._isNumber) {
95
+ return new Date(self.getTime() + (other * 1000));
96
+ }
97
98
+
99
+ raise TypeError, "Time#+"
100
101
102
def -(other)
- Time.allocate(self.to_f - other.to_f)
103
104
105
+ return new Date(self.getTime() - (other * 1000));
106
107
+ else {
108
+ return (self.getTime() - other.getTime()) / 1000;
109
110
111
112
113
def <=>(other)
0 commit comments