« first day (2019 days earlier)      last day (3152 days later) » 

19:06
Hrm, for some reason my regex is only working on half the items in my string. Despite the fact that texting on regex101 shows a valid expression.
Well there's officially witchcraft going on at my desk. I dropped my waterbottle cap, saw where it fell, and now it's literally gone.
I think all of the coldfusion you used to look at affected your sanity
I've scoured a 5ft perimeter, no cap
!!tel SterlingArcher Here I am!
@SterlingArcher Here I am!
19:14
God dammit
I could use a code review. Trying to just improve my actual vanilla.
@Trasiva all your dates are off
also you can use, localDate.toLocaleString()
instead of the function you wrote
getMonth is 0 based, that's why your dates were off
@Loktar I thought .toLocaleString doesn't pad?
the pervasive use of "Proficy" confused me for a bit
just use moment
19:20
yeah the format is a bit different that what you had I guess @Trasiva
@Loktar If you looked at line 14, I took the zero base into consideration. Apparently it doesn't care about it.
03/25/16 at 19:58 (your method) vs 4/25/2016, 7:58:18 PM (toLocaleString)
thats just default w/o using options though
@Loktar Oh wow, I wonder how I skimmed over the options on that...
yeah it might not still fit exactly what you need
@Loktar It's interesting, I have to do the subtraction for the month if I do toLocaleString (which didn't do what I wanted, even with options), but with the way I'm doing it right now, it doesn't actually need it to correct the date. How's that for weird?
19:30
heh yeah that is weird
But other than that anomaly, anything else? I tried to make it as decent as I could off no sleep.
Handling Dates in JS is hellish; Moment is one of the few libraries that I will endorse until the day I die
oh, I couldnt dig in too much since I'm working, I just glanced over the other stuff, I see a lot of modification to innerHTML which seems kind of meh but idk
@FlorianMargaine dunno if you know or not, but I just discovered ctrl+up/down on shout webui switches between open channels
@Trasiva newDiv.setAttribute("id", "logReports"); -> newDiv.id = 'logReports'
19:32
you could probably use textContent for element content.
@ndugger I almost looked into monument since it gets mentioned a lot here, I just figured I'd take a crack at it.
@Trasiva I would avoid using innerHTML at all, even to clear an element; while(element.firstChild) element.firstChild.remove()
navDiv could be an actual nav
@AwalGarg didn't, thanks
and newDiv is a bit ambiguous
oh man I see what you're doing here, I didn't even look at what the code was actually doing..
You basically just have to reformat dates?
Where do the dates originally come from?
Seems kind of brittle to reformat the dates by using regex on innerHTML idk
19:35
this line is scary:
> new Date(Date.UTC(Number(newLine[1]), Number(newLine[2]) - 1, Number(newLine[3]), Number(newLine[4]), Number(newLine[5]), Number(newLine[6])));
@Loktar The HTML above. The reason I have to do it so wonky is that the actual logs aren't in a separate div or anything.
right, but where do the logs come from?
@ndugger How is that scary? I know what my regex values are.
Like what outputs this to a page?
I'm thinking I should have a switch in my code for when I'm dev or pro, then I don't have to manage 2 sets of files.
19:36
@Trasiva but developer #2 won't
^ it's not readable by someone else
@Loktar Oh, the game's servers. It's just a website where you can view certain things like organisation logs.
I'm saying it would be smarter and most likely better to do this on whatever is outputting the logs to begin with
ah, so something you have 0 control over?
@Loktar Exactly
This is all tempermonkey scripts stuff for the record.
So I'm not terribly worried about someone coming in behind me. Obviously if this was publically released code I'd variable all the items into an object before passing them to the new date() stuff.
in that case you could do, container.innerHTML.match(regEX).forEach(function(line) {
and get rid of the array var you made
but yeah idk, lol knowing its a script makes it much more whatever :P
I thought this was work related or something
19:41
@Loktar Nah, today's mostly a stand down day. I've been wrapping up a lot of bullshit stuff today. Tomorrow I start figuring out website improvements for our site.
@Trasiva first improvement s/\s{2}/\t/g
;)
var utcTime ={
    	year: Number(newLine[1]),
      month: Number(newLine[2]),
      day: Number(newLine[3]),
      hours: Number(newLine[4]),
      minutes: Number(newLine[5]),
      seconds: Number(newLine[6]),
    };
    var localDate = new Date(Date.UTC(utcTime.year, utcTime.month, , utcTime.day, utcTime.hours, utcTime.minutes, utcTime.seconds));
@ndugger Happier?
Uno momento poor favour
I'm making some edits
newLine = newLine.map(Number)
^ that too
19:44
then you don't have so much duplication
destructuring would benefit you
dunno your support level
can't he just apply?
if he reverses the array
utcTime is converting each one to a number, but in order
so Date.UTC.apply(null, newLine.map(Number))?
29 secs ago, by rlemon
if he reverses the array
note the index order
nvm, I'm dumb
but the month is off by one
19:45
@TZANΑθηνά Welcome to the JavaScript chat! Please review the room rules. Please don't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
are we looking at the same code? year is array 1 and arg 1
but the first index still needs to change
yeah, need to discard #0
Date.UTC.apply(null, newLine.map(Number).slice(1))
it's some weird code, but way more concise
19:47
Date.UTC(...newLine.map(Number).slice(1))
@rlemon What am I missing here? You want to check for a string instance that happens twice, and a tab?
does spread work here?
I think it would
@Trasiva replace double space with tab.
your indentation is clearly wrong
stackoverflow.com/q/36874367/6220751 duplicate (did I do that right?)
@rlemon I'm pulling this text off a site I have no control over the back end of. I'm just tired of constantly doing UTC > Local in my head, so I just started writing a TM script.
I cannot close vote yet so I just flagged.
19:49
@Tuvia that dupe isn't right, m8
most graphs use SVG, not canvas
11k asking such a crap question tho
@ssube I checked the source, it is using canvas
@Trasiva just a few updates to make it cleaner jsfiddle.net/tap75k5p/9
You can add in your utcTime dictionary to help even more
Neo
Neo
Hello all
I need help here please :) stackoverflow.com/questions/36874440/…
19:51
whoa. How did "Community" vote as a duplicate?
@ndugger Huh, using divs for each line makes a hell of a lot more sense.
@Trasiva Also, see how I got rid of you having to have the exact same regex in two different vars in different scopes
@Neo there is no spoon
Just define it once, and use new RegExp to change the flags
Neo
Neo
haha you're funny... ><
19:57
Nodejs v6 is about to release, supports 93% of ES6 :>
@ndugger Yea, you're right. That's much more common sense based. Only an hour and I can actually try and sleep tonight.
@BenFortune will it be LTS?
because I can't keep up with these releases
@rlemon Nah, just current
It'll be stable though
"stable"
@Trasiva You probably already know this, but I found that the hardest part about learning programming was learning the built in APIs that you have available to use. Once you know what tools you have in your belt, learning how to actually maneuver the logic is super easy.
What does that even mean anymore?
yea well my current gameplan has been to adopt each new stable as I start new projects
I had an idea for a game where each player controls their localized reality (via scripting).
but that means I now have one project on node 4.X and one on 0.8.x
@rlemon clicking the send button causes the code editor to engage
19:59
@ndugger Yea, I'm trying to familiarize myself with as much of the kit vanilla has to offer. So much of our stuff was written when jQuery was popular, I want to move us away from it.
@Shmiddty I am aware
but also, lazy

« first day (2019 days earlier)      last day (3152 days later) »