« first day (12 days earlier)      last day (195 days later) » 

13:17
@IsmaelMiguel what other languages do you code in besides Javascript?
I'm guessing PHP because it's the only tag I could find at a quick glance at his SO profile ;P
14:03
@Malachi Just Javascript and PHP.
I had a few classes of C#and C, but I forgot almost everything
And Pascal and Visual Basic (.net, VB6) and some VBA
14:24
Visual Basic.... the good ol days...lol
I am trying to get rid of VB in all my projects....lol forcing everyone else to Learn C# or GET OUTTA HERE...JK
I haven't touched in VB6 for 4 years
Or 5
A long time
I made a few things in C#
Then I did a few in VB.net
Then I did a very crude keylogger in VB
I used to program in TI-Basic when I was on 10th-12th grade
(I made a paint program that used every single label you could create)
(If I'm not mistakened)
lol, fun
It was
Either that or sleeping in Math
14:42
lol right!?
The worst part was when I was caught.
He would come by me and, with his super-funny jokes, blurt out something like:
"So, are you playing flea-catcher?"
"Stop playing Pokemon and pay attention"
 
6 hours later…
20:41
I am trying to set a max date for a jquery date picker, and I found some fun code, but part of it won't work.
I tried to do something similar once
maxDate = AddToNowDate('y', -18);
            function AddToNowDate(type, amount) {
                var y = Date.Now.getFullYear(),
                    m = Date.Now.getMonth(),
                    d = Date.Now.getDate();
                if (type === 'y') {
                    y += amount;
                };
                if (type === 'm') {
                    m += amount;
                };
                if (type === 'd') {
                    d += amount;
                };
                return new Date(y, m, d);
ugh. hold on
I got it.
it must be old code. it didn't like getFullYear() I had to get rid of the parenthesis and change some other things. but now I got it to work
Date.Now <-- never saw this before
I don't think it works. if I post something like this on SO I bet it will get downvoted. here is what the code looks like now
//Try to set the minimum Age for the DOB to 18
            $(function () {
                var maxDate = Date.now();
                //maxDate.setFullYear(maxDate.getFullYear - 18);
                maxDate = AddToNowDate('y', -18);
                function AddToNowDate(type, amount) {
                    var date = Date.now()
                    var y = date.getFullYear,
                        m = date.getMonth,
                        d = date.getDate;
                    if (type === 'y') {
                        y += amount;
I hate the formatting in chat....lol
Date.now() returns a timestamp. Use new Date().
20:57
okay, so now I get the undefined date --> return new Date(y, m, d);
let me see if I can rewrite this
I think I can do it better
Try running it in the console
@Malachi Your problem is that you removed the () after the method names
getFullYear() doesn't work
says it isn't a function
Hum
I told you to use new Date() instead of Date.now()
var date = New Date();console.log(date.getFullYear())
doesn't work▲▲▲
*new
not New
new Date(); works, New Date(); doesn't
IE is a garbage and doesn't let me copy what I wrote
            function AddToNowDate(type, amount) {
                var date = new Date();
                var y = date.getFullYear(),
                    m = date.getMonth(),
                    d = date.getDate();
                if (type === 'y') {
                    y += amount;
                };
                if (type === 'm') {
                    m += amount;
                };
                if (type === 'd') {
                    d += amount;
                };
                return new Date(y, m, d);
21:08
var maxDate = new Date();
maxDate.setFullYear(maxDate.getFullYear - 18);
doesn't work either▲▲▲
maxDate.setFullYear(maxDate.getFullYear() - 18); <-- that does
@IsmaelMiguel trying this right now
@IsmaelMiguel good gravy
It ran on IE, so, must run on anything
I hate JavaScript
there is some javascript that only runs on IE <-- Believe it or not
But that is broken Javascript
And don't hate on Javascript
You were doing it wrong this time
(Javascript does many wrong things, but PHP does more)
2
21:20
now I need to make the DatePicker start 18 years ago....
Try maxDate:'-18y'
in the .datepicker properties?
I have a max date that is supposedly working, but the popup still shows 2015
Actually
21:24
so I am going to set the defaultDate to the max date as well
Use minDate
So no one can select a date that's less than 18 years from today
this is for a search page, and I don't want users searching for someone under 18
Then use minDate: '-18y'
21:56
@IsmaelMiguel that didn't work either. it still shows the current month and year in the date picker
this is what I am using, but I also have a jquery mask in there as well --> jqueryui.com/datepicker
I've noticed that datepicker has gotten worst
the documentation says that it MUST work
right?
File a bug?

« first day (12 days earlier)      last day (195 days later) »