How to populate two drop-downs in JQuery with to/from dates

If you ever need to populate two sets of drop-downs with the from and to hours, use the following script in your head section:

        $(document).ready(function () {
            var i = 0;

            for (var i = 0; i var ampm = i % 24 'AM' : 'PM';

                var hours = i % 12;
                if ((hours === 0) && (i!=0)) {
                    hours = 12;
                var valueString = ("0" + hours.toString()).slice(-2) + " " + ampm;

                        .attr('value', i)
                        .attr('value', i)
            for (var i = 0; i var valueString = ("0" + i.toString()).slice(-2);

                        .attr('value', i)
                        .attr('value', i)

Output will be two sets of drop-downs with “From and To Times”


Calling WCF Web-Service from behind a proxy server

If you ever have any issues bypassing a proxy server in order to call a webservice (WCF or SOAP), you can modify your web-config file to show the following:

<defaultProxy useDefaultCredentials=”true”>
<proxy proxyaddress=”http://AAA.BBB.CCC.DDD:PORTNO&#8221; usesystemdefault=”True” />


The proxy settings are part of the binding configuration.


        <binding name="Binding1"
                 proxyAddress = "http://myProxy">
          <security mode="None" />