inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Aug 29, 2015 4:25:59 GMT -8
That still makes zero sense to me equestriads3.com/ < See that box to the right which says Year 1 Season Spring I'm looking to make it so that a code does updates the number for the year and the season (currently spring) I just need to output those two in code
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,017
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Aug 29, 2015 4:58:27 GMT -8
Give the H2 that contains the year an ID or CLASS so it can be easily addressed and do the same for the H2 containing the season.
So for example you give it a class of "year" and "season" then var accelerated_date = speedDate("Aug 28, 2014", 1.3); $('h2.year').html(accelerated_date.getFullYear()); $('h2.season').html(getSeason(accelerated_date))
(e.g. the year would be something like "2015" )
If however by year you mean age (which I am starting to suspect after looking at that page) then subtract the start year from the calculated year to get the age.
var accelerated_date = speedDate("Aug 28, 2014", 1.3); $('h2.year').html(accelerated_date.getFullYear() - 2014); $('h2.season').html(getSeason(accelerated_date))
You use the output of the functions to generate content then target where you want it to appear, does that make more sense?
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Aug 29, 2015 5:29:11 GMT -8
Not really @_@ like I get 'how' it works but I don't get 'how' it works
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,017
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Aug 29, 2015 5:38:51 GMT -8
The code has ample comments if you wish to study 'how' it works, if by 'how' you mean something else then elaborate
|
|
inherit
201984
0
Sept 11, 2023 1:23:07 GMT -8
P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓
Using My Talents Elsewhere
3,314
November 2013
pastuleo23
|
Post by P̌̓aͧś̀t̀u͒le͆o͂2̀3̃̓ on Aug 29, 2015 10:41:37 GMT -8
Not really @_@ like I get 'how' it works but I don't get 'how' it works Are you asking to understand the innermost workings or more about how to use them?
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Aug 29, 2015 11:38:57 GMT -8
Not really @_@ like I get 'how' it works but I don't get 'how' it works Are you asking to understand the innermost workings or more about how to use them? How to use them primarily followed by how it works (but I can self study if need be)
|
|
inherit
Official Code Helper
65613
0
1
Oct 22, 2024 1:56:19 GMT -8
Chris
"'Oops' is the sound we make when we improve"
9,017
December 2005
horace
RedBassett's Mini-Profile
|
Post by Chris on Sept 1, 2015 20:28:15 GMT -8
Three functions, - speedDate - outputs an accelerated/decelerated date. This function is used to generate a date which in your case fits a full year into the space of 8 months. To do that divide 12 by 8 to get the speed factor. Since all you want from this returned date is the year then call the getFullYear() method of the returned date object. If you want the age instead, which is the difference between the born date (start date) and the generated date then subtract one from the other then output it to a div, span, whatever of your choice
- getSeason - returns a season when given a date. Plug in the date you just got from speedDate to determine the season then output it to a div, span, whatever of your choice.
- isDate - a helper function to verify valid dates and returns a boolean value
|
|