Closed
Bug 297827
Opened 20 years ago
Closed 20 years ago
need calIDuration
Categories
(Calendar :: Internal Components, defect)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: pavlov, Assigned: pavlov)
Details
Attachments
(1 file, 1 obsolete file)
|
23.82 KB,
patch
|
shaver
:
second-review+
|
Details | Diff | Splinter Review |
We need a calIDuration for expressing things that aren't really dates. We also need them for alarms which need to be able to express ical duration strings...
| Assignee | ||
Comment 1•20 years ago
|
||
Attachment #186392 -
Flags: second-review?(shaver)
Attachment #186392 -
Flags: first-review?(vladimir)
| Assignee | ||
Comment 2•20 years ago
|
||
in calEvent.js's duration getter it should be: |return this.endDate.subtract(this.startDate);| instead of whats in the patch
Comment 3•20 years ago
|
||
Comment on attachment 186392 [details] [diff] [review] patch to add calIDuration and to start using it >+ // Subtract two dates and return a duration >+ calIDuration subtractDate (in calIDateTime aOtherDate); It's not clear from this name or comment which way the subtraction happens. How would you feel about // Compute the time from this dateTime to otherDT and return it as // a calIDuration. The duration will be negative if otherDT is // before this. calIDuration durationUntil(in calIDateTime otherDT); ? >+ /** >+ * This object as either an iCalendar DURATION string >+ */ >+ readonly attribute ACString icalString; >+}; ...an iCalendar DURATION string or...? >+ nsCOMPtr<calIDuration> result(do_CreateInstance("@mozilla.org/calendar/duration;1")); OOM check? (You could also just call |new| here, since it's a closed system, if you wanted.) r=shaver
Attachment #186392 -
Flags: second-review?(shaver) → second-review+
| Assignee | ||
Comment 4•20 years ago
|
||
I added the comments/oom checks you suggested shaver. I left the method as subtractDate but commented it better. I also added an addDuration method on calIDuration that would add two durations together and normalize the result. I've also added a normalize function to the interface just incase anyone wants it. I added an attribute |inSeconds| that you can get/set the duration in seconds with. Someone should check my math in SetInSeconds() to make sure its right as well.
Attachment #186392 -
Attachment is obsolete: true
Attachment #186407 -
Flags: second-review?(shaver)
Attachment #186407 -
Flags: first-review?(vladimir)
| Assignee | ||
Updated•20 years ago
|
Attachment #186392 -
Flags: second-review+
Attachment #186392 -
Flags: first-review?(vladimir)
Comment on attachment 186407 [details] [diff] [review] Updated with shaver's comments and new functions r=me, go go go
Attachment #186407 -
Flags: first-review?(vladimir) → first-review+
Comment 6•20 years ago
|
||
Comment on attachment 186407 [details] [diff] [review] Updated with shaver's comments and new functions 2r=shaver, thx
Attachment #186407 -
Flags: second-review?(shaver)
Attachment #186407 -
Flags: second-review+
Attachment #186407 -
Flags: first-review?(vladimir)
Attachment #186407 -
Flags: first-review+
| Assignee | ||
Updated•20 years ago
|
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Updated•20 years ago
|
Attachment #186407 -
Flags: first-review?(vladimir)
You need to log in
before you can comment on or make changes to this bug.
Description
•