PAC: weekdayRange() see comment 8

REOPENED
Assigned to

Status

()

Core
Networking
P5
normal
REOPENED
17 years ago
10 months ago

People

(Reporter: benc@chuang.net, Assigned: serge (gone))

Tracking

Trunk
mozilla0.9.4
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [necko-would-take])

(Reporter)

Description

17 years ago
Regarding deprecated function, here is implementation of weekdayRange():
------------------------------------------------------
var date = new Date();

var wdays = new Array("SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT");

function weekdayRange() {
    function getDay(weekday) {
        for (var i = 0; i < 6; i++) {
            if (weekday == wdays[i])
                return i;
        }
        return -1;
    }
    var argc = arguments.length;
    var wday;
    if (argc < 1)
        return false;
    if (arguments[argc - 1] == "GMT") {
        argc--;
        wday = date.getUTCDay();
    } else {
        wday = date.getDay();
    }
    var wd1 = getDay(arguments[0]);
    var wd2 = (argc == 2) ? getDay(arguments[1]) : wd1;
    return (wd1 == -1 || wd2 == -1) ? false
                                    : (wd1 <= wday && wday <= wd2);

}

Comment 1

17 years ago
qa to me
depends on 53080
Depends on: 53080
OS: Windows 3.1 → All
QA Contact: tever → benc

Updated

17 years ago
Target Milestone: --- → mozilla0.9.3

Updated

17 years ago
No longer depends on: 53080

Comment 2

17 years ago
-->PAC bugs to Jussi
Assignee: neeti → jpm

Updated

17 years ago
QA Contact: benc → pacqa

Comment 3

17 years ago
Serge, can you take a look at these PAC issues? Thanks - Jussi-Pekka
Assignee: jpm → serge

Comment 4

17 years ago
Doesn't look like this is getting fixed before the freeze tonight.
Pushing out a milestone.  Please correct if I'm mistaken.
Target Milestone: mozilla0.9.3 → mozilla0.9.4

Updated

17 years ago
Blocks: 79893

Comment 5

17 years ago
I can't figure out what this bug is about -- the implementation given in the
summary went in as part of the PAC overhaul.  weekdayRange() is apparently
deprecated, but I assume that doesn't mean we're going to rip it out again.

I smell an easy resolution.  cc'ing gagan in case he knows something I don't.

Comment 6

17 years ago
I filed it because I was trying to rip all issues out of the bugs that had
morphed into many-headed hydras.

If it works and it's in, we are good.

Comment 7

17 years ago
I did some basic testing to make sure that it behaves, and everything seems ok.

Marking FIXED.
Status: NEW → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED

Comment 8

13 years ago
REOPEN: (Since there is only one bug in the history of this function...)

I've been writing a whitebox/harness test for this function, and found the following:

1- The number of arguments is not properly enforced because after GMT is stripped, the number of arguments is not enforced.

2- The wrap-around date is not supported.

Status: RESOLVED → REOPENED
QA Contact: pacqa → benc
Resolution: FIXED → ---
Summary: PAC: weekdayRange() → PAC: weekdayRange() see comment 8
Whiteboard: [necko-would-take]
You need to log in before you can comment on or make changes to this bug.