Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server-based appointment date max/min checking appears to fail when timezone doesnt match client timezone. #17

Open
ripdog opened this issue Sep 9, 2014 · 0 comments

Comments

@ripdog
Copy link
Owner

ripdog commented Sep 9, 2014

regarding

            var cleanDate = moment(this.value).startOf('day');
            var provObject = unusualDays.findOne({date: cleanDate, providerID: this.field("providerID").value});
            if (typeof provObject === "undefined") {
                provObject = providers.findOne(this.field("providerID").value);
            }
            //this may fail due to timezone? try on nz timezone server.
            if(moment(this.value).isValid() === false) {
                return "wtf"
            }

            else if (moment(this.value).isBefore(cleanDate.zone(-12).hours(provObject.startTime).utc())) {
                return "minDate"
            }
            else if (moment(this.value).isAfter(cleanDate.zone(-12).hours(provObject.endTime).utc())) {
                return "maxDate"
            }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant