LCC: Washington YRQ Auto Builder

Update 5/15/2018 Upgraded Decode due to 2019/2020 issue (resolves all future years as well).

Update 2/27/2012 Upgraded Winter/Spring Encode function due to one-off year result.


Code: WA YRQ Library File: waYRQEncodeDecode.zip
On-line Demo: WA YRQ Encoder/Decoder
Command Line/Windows Versions

Auto Build #1: YRQ YYYY-YY (with values = YYYY-YY, i.e. 2011-12)
For last 7 years, with current year auto-selected.
[ Show Current Value ]
<script language="JavaScript">
lccAutoFillYRQ(0,"yrq",-6,7,"current");
</script>

Auto Build #2: YRQ Quarter YYYY (with values = YRQ, i.e. B122)
For last 3 years, with current year auto-selected.
Note: this example is using 'yrq2' since I am using 'yrq' already in the previous example. These are live examples.
[ Show Current Value ]
<script language="JavaScript">
lccAutoFillYRQ(1,"yrq2",-2,4,"current");
</script>

Auto Build #3: YRQ Quarter YYYY (with values = YRQ, i.e. B122)
For last 3 years and next year, with Summer 2011 auto-selected
Note: this example is using 'yrq3' since I am using 'yrq' already in the previous example. These are live examples.
[ Show Current Value ]
<script language="JavaScript">
lccMasterAutoSelectYear = 2011;
lccMasterAutoSelectQuarter = 1; 
lccAutoFillYRQ(1,"yrq3",-2,4,"current");
</script>

Auto Build #4: Quarter (with values = Quarter # - Quarter, i.e. 2 - Fall)
With quarter auto-selected according to value in 'lccMasterAutoSelectQuarter'
Note: These are live examples.
[ Show Current Value ]
<script language="JavaScript">
lccMasterAutoSelectYear = 2011;
lccMasterAutoSelectQuarter = 2; 
lccAutoFillYRQ(2,"yrq4",0,0,"current");
</script>

Notes/Usage

Syntax: lccAutoFillYRQ([FLAG],[SELECT OBJECT],[GO BACK # YEARS],[# YEARS TO SHOW],[AUTO SELECT]);

Both of the above Auto Builds use the function: lccAutoFillYRQ

This function utilizes code from the JavaScript library file: waYRQEncodeDecode.js

To ulitilize, include the library file in your page (recommended in the HEAD section) and call the function. Then run the function AFTER the SELECT section of your HTML.


Example: Linking to library in HEAD section:
Example: Running the function after the SELECT section:
Example: To set a Master Year/Quarter for any pages calling the lccAutoFillYRQ function:
Example: To set a Master Year/Quarter for a specific page using the lccAutoFillYRQ function for Winter 2009: