<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>ash baker</title>
	<atom:link href="http://ashleybaker.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://ashleybaker.co.uk</link>
	<description>links to urls i&#039;d lose.</description>
	<lastBuildDate>Mon, 20 Feb 2012 19:17:52 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2</generator>
		<item>
		<title>FairFX SMS Codes</title>
		<link>http://ashleybaker.co.uk/fairfx-sms-codes/</link>
		<comments>http://ashleybaker.co.uk/fairfx-sms-codes/#comments</comments>
		<pubDate>Mon, 20 Feb 2012 19:17:51 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ashleybaker.co.uk/?p=120</guid>
		<description><![CDATA[To find balance: FAIR BAL 6789 to 60040 where 6789 is the last 4 digits of your FairFX currency card To top up Text FAIR 300 USD 6789 to 60040 where 300 is the amount, USD is the requested currency &#8230; <a href="http://ashleybaker.co.uk/fairfx-sms-codes/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p><b>To find balance:</b></p>
<p>FAIR BAL 6789 to 60040 where 6789 is the last 4 digits of your FairFX currency card</p>
<p><b>To top up</b></p>
<p>Text <strong>FAIR 300 USD 6789 </strong>to 60040 where <em>300</em> is the amount, <em>USD</em> is the requested currency (GBP, EUR or USD) and <em>6789</em> is the last 4 digits of your <em>FairFX currency card</em>.  .</p>
<p>then&#8230;.</p>
<p>Text <strong>FAIR BUY 123 6666</strong> to 60040 where <em>123</em> is the 3 digit security number (CVV) from the back of your <em>payment card</em> and <em>6666</em> is the last 4 digits of your <em>payment card number</em>. Your payment card is the debit or credit card you want to use to buy the currency, the details of which you have already saved on this site. No charge is levied by FairFX for this service, ordinary text rates apply.</p>
]]></content:encoded>
			<wfw:commentRss>http://ashleybaker.co.uk/fairfx-sms-codes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Error -10810 &#8220;The application Finder can&#8217;t be opened&#8221; &#8211; fix</title>
		<link>http://ashleybaker.co.uk/error-10810-the-application-finder-cant-be-opened-fix/</link>
		<comments>http://ashleybaker.co.uk/error-10810-the-application-finder-cant-be-opened-fix/#comments</comments>
		<pubDate>Sat, 18 Feb 2012 11:30:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[10810]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[finder]]></category>
		<category><![CDATA[os x]]></category>

		<guid isPermaLink="false">http://ashleybaker.co.uk/?p=118</guid>
		<description><![CDATA[to fix this error message: just go to terminal (cmd+space to open spotlight, type terminal, hit enter) and enter this (and hit enter after) finder should open then (did with me). To get the dock showing it correctly do this &#8230; <a href="http://ashleybaker.co.uk/error-10810-the-application-finder-cant-be-opened-fix/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>to fix this error message:</p>
<pre class="brush: plain; title: ; notranslate">
Error -10810 &quot;The application Finder can't be opened&quot; - fix
</pre>
<p>just go to terminal (cmd+space to open spotlight, type terminal, hit enter) and enter this (and hit enter after)</p>
<pre class="brush: plain; title: ; notranslate">
/System/Library/CoreServices/Finder.app/Contents/MacOS/Finder
</pre>
<p>finder should open then (did with me). To get the dock showing it correctly do this in terminal:</p>
<pre class="brush: plain; title: ; notranslate">
osascript -e 'tell application &quot;Dock&quot; to quit'
</pre>
]]></content:encoded>
			<wfw:commentRss>http://ashleybaker.co.uk/error-10810-the-application-finder-cant-be-opened-fix/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Clean Up Word Special Characters online tool</title>
		<link>http://ashleybaker.co.uk/clean-up-word-special-characters-online-tool/</link>
		<comments>http://ashleybaker.co.uk/clean-up-word-special-characters-online-tool/#comments</comments>
		<pubDate>Fri, 17 Feb 2012 09:53:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[html]]></category>
		<category><![CDATA[html entities]]></category>
		<category><![CDATA[microsoft word]]></category>
		<category><![CDATA[special characters]]></category>
		<category><![CDATA[word]]></category>

		<guid isPermaLink="false">http://ashleybaker.co.uk/?p=116</guid>
		<description><![CDATA[When pasting in content from word you get the things like curly quotes etc. This tool &#8211; http://www.boallen.com/clean-up-word-special-characters.html seems to clear most of them up instantly (without sending it back to their server too).]]></description>
			<content:encoded><![CDATA[<p>When pasting in content from word you get the things like curly quotes etc. This tool &#8211; <a href='http://www.boallen.com/clean-up-word-special-characters.html'>http://www.boallen.com/clean-up-word-special-characters.html</a> seems to clear most of them up instantly (without sending it back to their server too).</p>
]]></content:encoded>
			<wfw:commentRss>http://ashleybaker.co.uk/clean-up-word-special-characters-online-tool/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Delete Missing Tracks from your iTunes library in os x</title>
		<link>http://ashleybaker.co.uk/delete-missing-tracks-from-your-itunes-library-in-os-x/</link>
		<comments>http://ashleybaker.co.uk/delete-missing-tracks-from-your-itunes-library-in-os-x/#comments</comments>
		<pubDate>Mon, 23 Jan 2012 14:45:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[itunes]]></category>
		<category><![CDATA[os x]]></category>

		<guid isPermaLink="false">http://ashleybaker.co.uk/?p=114</guid>
		<description><![CDATA[Use this script to delete missing tracks from your iTunes library in os x. The scripts menu is the one after Window with an icon. Took me a minute to find it&#8230;]]></description>
			<content:encoded><![CDATA[<p><a href='http://dougscripts.com/itunes/scripts/ss.php?sp=removedeadtracks'>Use this script</a> to delete missing tracks from your iTunes library in os x. The scripts menu is the one after Window with an icon. Took me a minute to find it&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://ashleybaker.co.uk/delete-missing-tracks-from-your-itunes-library-in-os-x/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting the &#8220;Panic&gt; Unsupported CPU: family&#8221; error on booting up mac? this *might* fix it</title>
		<link>http://ashleybaker.co.uk/getting-the-panic-unsupported-cpu-family-error-on-booting-up-mac/</link>
		<comments>http://ashleybaker.co.uk/getting-the-panic-unsupported-cpu-family-error-on-booting-up-mac/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 15:14:59 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Computers]]></category>
		<category><![CDATA[error]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[os x]]></category>
		<category><![CDATA[osx]]></category>
		<category><![CDATA[samsung n150]]></category>

		<guid isPermaLink="false">http://ashleybaker.co.uk/?p=104</guid>
		<description><![CDATA[Loved my macbook air, but needed something cheap and smaller in size so i got a hackintosh netbook (samsung n150) from ebay. It was working great, until I saw an application called osx86tools, which had a tool to change the &#8230; <a href="http://ashleybaker.co.uk/getting-the-panic-unsupported-cpu-family-error-on-booting-up-mac/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Loved my macbook air, but needed something cheap and smaller in size so i got a hackintosh netbook (samsung n150) from ebay. It was working great, until I saw an application called osx86tools, which had a tool to change the cpu name. I decided to click &#8216;set to default&#8217;&#8230; once i restarted it no longer worked and said the cpu family was unsupported (edit &#8211; not actually 100% sure if that was the cause&#8230;). Bit of a stupid mistake, but posting this here because it might help someone fix that error.</p>
<p>When booting up, press tab and you should get boot options. press tab again to get the command line and enter (no quotes) &#8220;arch=i386 recovery=y&#8221; and hit enter. doing it with just one (either arch=i386, or recovery=y) won&#8217;t work (didn&#8217;t for me anyway) &#8211; it has to be both.</p>
<p>It should work. Hopefully. Might have to do it every single time though&#8230; </p>
<p>note to self&#8230; don&#8217;t play with useless settings that won&#8217;t even do anything&#8230; also gotta get sound working on it now&#8230;</p>
<p><a href='http://code.google.com/p/netbook-installer/issues/detail?id=311'>http://code.google.com/p/netbook-installer/issues/detail?id=311 for more</a></p>
<p>Update: under /extra there is a com.apple.boot.plist. Add this: (no quotes) &#8220;arch=i386 recovery=y&#8221; to kernel flags ( in terminal cd /extra;sudo vi com.apple.boot.plist; then edit (press i to enter insert mode) &#8211; add &#8216;arch=i386 recovery=y&#8217; between the two &gt;&lt; under kernel flags)</p>
<p>If none of your kexts are loading (no sound, no wifi, and there was), might be worth checking if the kexts are installed. if not, find them again (they were in some auto made backup dir) and put them into kext helper b7 (which will auto install them)</p>
<p>also, try rebuilding the kext cache. there was an app called something updater that did it for me, but i can&#8217;t remember the name&#8230; i&#8217;ll try and edit this when i&#8217;m back on that machine.</p>
]]></content:encoded>
			<wfw:commentRss>http://ashleybaker.co.uk/getting-the-panic-unsupported-cpu-family-error-on-booting-up-mac/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Subtle Patterns (for backgrounds) for web design</title>
		<link>http://ashleybaker.co.uk/subtle-patterns-for-backgrounds-for-web-design/</link>
		<comments>http://ashleybaker.co.uk/subtle-patterns-for-backgrounds-for-web-design/#comments</comments>
		<pubDate>Tue, 03 Jan 2012 21:49:29 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[backgrounds]]></category>
		<category><![CDATA[patterns]]></category>
		<category><![CDATA[photoshop]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://ashleybaker.co.uk/?p=94</guid>
		<description><![CDATA[Quite a few patterns on subtlepatterns.com, under creative commons.]]></description>
			<content:encoded><![CDATA[<p>Quite a few patterns on <a href='http://subtlepatterns.com/?page_id=854'>subtlepatterns.com</a>, under creative commons.</p>
<p><a href="http://subtlepatterns.com/?page_id=854"><img style="display:block; margin:5px auto;" src="http://ashleybaker.co.uk/wp-content/uploads/2012/01/Subtle-Patterns-Free-textures-for-your-next-web-project.jpg" alt="Subtle Patterns | Free textures for your next web project" title="Subtle Patterns | Free textures for your next web project" border="0" width="500"   /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://ashleybaker.co.uk/subtle-patterns-for-backgrounds-for-web-design/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP 5.4.0 New Features</title>
		<link>http://ashleybaker.co.uk/php-5-4-0-new-features/</link>
		<comments>http://ashleybaker.co.uk/php-5-4-0-new-features/#comments</comments>
		<pubDate>Thu, 22 Dec 2011 10:00:47 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[php 5.4.0]]></category>

		<guid isPermaLink="false">http://ashleybaker.co.uk/?p=76</guid>
		<description><![CDATA[With the PHP 5.4.0 RC3 released last week, 5.4.0 will be arriving soon. As well as a whole bunch of bug fixes, there are a few new interesting features. Here is a selection of some of the more interesting or &#8230; <a href="http://ashleybaker.co.uk/php-5-4-0-new-features/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>With the <a href="http://www.php.net/archive/2011.php#id2011-12-14-1">PHP 5.4.0 RC3 released last week</a>, 5.4.0 will be arriving soon. As well as <a href='https://svn.php.net/repository/php/php-src/tags/php_5_4_0RC3/NEWS'>a whole bunch of bug fixes</a>, there are a few new interesting features. Here is a selection of some of the more interesting or handy features</p>
<h2>Magic quotes removed</h2>
<p>The 4th August PHP 5.4.0 Alpha 3 was the version where they removed magic quotes. (Finally!)</p>
<pre class="brush: plain; title: ; notranslate">
- Removed features:
  . Removed magic_quotes_gpc, magic_quotes_runtime and magic_quotes_sybase
    ini options. get_magic_quotes_gpc, get_magic_quotes_runtime are kept
    but always return false, set_magic_quotes_runtime raises an
    E_CORE_ERROR. (Pierrick, Pierre)
</pre>
<h2>@ Operator speed increase</h2>
<p>Using the @ operator (silence) to ignore any errors has been given some speed increases, which should help scripts that use a lot of them.</p>
<pre class="brush: php; title: ; notranslate">
$file = @file_get_contents('/invalid'); // faster in 5.4.0
</pre>
<h2>$GLOBALS initialized only if used</h2>
<p>The <a href="http://php.net/manual/en/reserved.variables.globals.php">$GLOBALS</a> variable is only initialised if it is used. May cause bugs in existing scripts.</p>
<h2>Array dereferencing support added</h2>
<p>A neat trick that means you don&#8217;t have to store the returned result to a temporary variable when you want to access a certain array item. In &lt; php 5.4.0 you had to do this:</p>
<pre class="brush: php; title: ; notranslate">
function example() {
return array(
1 =&amp;gt; 'first result',
2 =&amp;gt; 'result you want'
);
} 

$tmp =  example();
echo $tmp[2];
</pre>
<p>But in php 5.4.0 you can do this:</p>
<pre class="brush: php; title: ; notranslate">

function example() {
return array(
1 =&amp;gt; 'first result',
2 =&amp;gt; 'result you want'
);
} 

echo example()[2];
</pre>
<h2>Binary value support added</h2>
<p>Binary values can be used in php, for example:</p>
<pre class="brush: php; title: ; notranslate">
$num = 0b001010
</pre>
<h2>Support for traits has been added</h2>
<p>Traits are a new feature to PHP that lets you easily reuse code in classes. Because a class can only inherit one class (although of course the parent class(es) could inherit more), using traits allows you to easily reuse sets of methods in different classes.</p>
<p>Traits are written in a similar way to classes, but they cannot be instantiated.</p>
<p>Example of a trait:</p>
<pre class="brush: php; title: ; notranslate">

&lt;?php

trait example_trait {

	function example_function_from_trait() {
		echo 'example';
	}

}

class example_class1 {
	use example_trait; // &lt;&lt;--
	function __construct() {

		$this-&amp;amp;gt;example_function_from_trait();
			// uses function from the trait

}

}

?&gt;
</pre>
<p><a href='http://www.php.net/manual/en/language.oop5.traits.php'>Traits</a> have now been added to php 5.4.0.</p>
<h2>Using Anonymous Functions when stored as an array</h2>
<p>In the previous version of PHP you could store anonymous functions in arrays, but to call the anonymous function it required a temporary variable. </p>
<p>The old way of doing this (PHP 5.3.x):</p>
<pre class="brush: php; title: ; notranslate">
&lt;?
// set up the anonymous function, stored in an array
$anon_funcs = array();
$anon_funcs['sayhello'] = function()
{
echo 'Hello World!';
}
?&gt;
</pre>
<p>To call it in php 5.3.x:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?
$tmp = $anon_funcs['sayhello'];
$tmp();

//$anon_funcs['sayhello']() would not work
?&gt;
</pre>
<p>But now you don&#8217;t need that temporary variable, so in php 5.4.0 you can call it by just doing this:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?
$anon_funcs['sayhello']();
?&gt;
</pre>
<p>Which makes code shorter and neater.</p>
<h2>Short array syntax added</h2>
<p>No need for <b>array()</b>, you can just use [ and ]</p>
<pre class="brush: php; title: ; notranslate">
$array = [123,456,789101112];
</pre>
<h2>Built in web server (for testing)</h2>
<p>PHP now has a new SAPI module (cli-server) which is a built in web server that is intended for testing purposes. Here are some examples of using PHP&#8217;s built-in web server (from their <a href='http://docs.php.net/manual/en/features.commandline.webserver.php'>docs</a>). </p>
<p>It is run from the command line with</p>
<pre class="brush: plain; title: ; notranslate">php -S localhost:8000</pre>
<p>That command will use the document root of the current working directory. (So do the following command first to move to the directory you want to serve)</p>
<pre class="brush: bash; title: ; notranslate">
$ cd ~/public_html
$ php -S localhost:8000
</pre>
<p>If you want to start with a different document root for example ~/webfiles/), use this command:</p>
<pre class="brush: plain; title: ; notranslate">
php -S localhost:8000 -t ~/webfiles/
</pre>
<p>Then visit http://localhost:8000/ in your browser to view the pages.</p>
<p>You can use <strong>router scripts</strong>, which will &#8216;redirect&#8217; to the requested file. </p>
<p>If you use a router script and want to return the requested file (for example if a user goes to http://localhost:8000/image.jpg, and you want to show image.jpg) you must <b>return false</b>. This example should make sense &#8211; </p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
// router.php
if (preg_match('/\.(?:png|jpg|jpeg|gif)$/', $_SERVER['REQUEST_URI']))
    return false;    // serve the requested resource as-is.
else {
    echo 'Welcome to PHP'
}
?&gt;</pre>
<p>When using the following command, any image requests (for example http://localhost:8000/image.png) will show the image (if it exists of course), because the script will <b>return false</b>. If it isn&#8217;t a png/jpg/jpeg/gif request, it will echo &#8216;<b>Welcome to PHP</b>&#8216;. </p>
<pre class="brush: plain; title: ; notranslate">$ php -S localhost:8000 router.php
</pre>
<h2>E_ALL now includes E_STRICT</h2>
<p>E_ALL never used to include E_STRICT, you had to explicitly enable it if setting E_ALL. In PHP 5.4.0, E_STRICT is included in E_ALL.</p>
<h2>Closures in Classes</h2>
<p><a href='http://jburrows.wordpress.com/2011/06/24/the-state-of-functional-programming-in-php-5-3-x/#closure'>write up on closure changes here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://ashleybaker.co.uk/php-5-4-0-new-features/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Vim Tips</title>
		<link>http://ashleybaker.co.uk/vim-tips/</link>
		<comments>http://ashleybaker.co.uk/vim-tips/#comments</comments>
		<pubDate>Mon, 12 Dec 2011 02:48:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[macvim]]></category>
		<category><![CDATA[software developing]]></category>
		<category><![CDATA[vi]]></category>
		<category><![CDATA[vim]]></category>

		<guid isPermaLink="false">http://ashleybaker.co.uk/?p=74</guid>
		<description><![CDATA[http://mislav.uniqpath.com/2011/12/vim-revisited/ &#8211; vim revisited &#8211; always more tricks to vim to learn]]></description>
			<content:encoded><![CDATA[<p><a href='http://mislav.uniqpath.com/2011/12/vim-revisited/'>http://mislav.uniqpath.com/2011/12/vim-revisited/</a> &#8211; vim revisited</a> &#8211; always more tricks to vim to learn <img src='http://ashleybaker.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  </p>
]]></content:encoded>
			<wfw:commentRss>http://ashleybaker.co.uk/vim-tips/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Online billing on a SaaS site</title>
		<link>http://ashleybaker.co.uk/online-billing-on-a-saas-site/</link>
		<comments>http://ashleybaker.co.uk/online-billing-on-a-saas-site/#comments</comments>
		<pubDate>Fri, 09 Dec 2011 16:48:42 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[ecommerce]]></category>
		<category><![CDATA[online]]></category>
		<category><![CDATA[paypal alternative]]></category>

		<guid isPermaLink="false">http://ashleybaker.co.uk/?p=72</guid>
		<description><![CDATA[http://blog.ontestpad.com/2011/12/online-payments-for-saas-billing.html &#8211; Online Payments For SaaS Billing]]></description>
			<content:encoded><![CDATA[<p><a href='http://blog.ontestpad.com/2011/12/online-payments-for-saas-billing.html'>http://blog.ontestpad.com/2011/12/online-payments-for-saas-billing.html</a> &#8211; Online Payments For SaaS Billing </p>
]]></content:encoded>
			<wfw:commentRss>http://ashleybaker.co.uk/online-billing-on-a-saas-site/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Making Kevin Luck&#8217;s jQuery DatePicker library select the last day of the week</title>
		<link>http://ashleybaker.co.uk/making-kevin-lucks-jquery-datepicker-library-select-the-last-day-of-the-week/</link>
		<comments>http://ashleybaker.co.uk/making-kevin-lucks-jquery-datepicker-library-select-the-last-day-of-the-week/#comments</comments>
		<pubDate>Tue, 08 Nov 2011 14:30:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[datepicker]]></category>
		<category><![CDATA[jquery]]></category>

		<guid isPermaLink="false">http://ashleybaker.co.uk/?p=66</guid>
		<description><![CDATA[If you use http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/ &#8211; Kevin Lucks jQuery DatePicker v2 and are using the selectWeek option but want the last day of the week (i.e. Sunday) to be the date in the textbox, make these changes change this: to this &#8230; <a href="http://ashleybaker.co.uk/making-kevin-lucks-jquery-datepicker-library-select-the-last-day-of-the-week/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>If you use <a href='http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/'>http://www.kelvinluck.com/assets/jquery/datePicker/v2/demo/</a> &#8211; Kevin Lucks jQuery DatePicker v2 and are using the <strong>selectWeek</strong> option but want the last day of the week (i.e. Sunday) to be the date in the textbox, make these changes  </p>
<p>change this:</p>
<pre class="brush: jscript; title: ; notranslate">
 d = d.addDays(- (d.getDay() - Date.firstDayOfWeek + 7) % 7);
</pre>
<p>to this (add the +6, so it selects a date 6 days after the default. Modify this if you need a different day of the week. Can also play with this if you need the week before selected etc. Have a search in the source code for &#8216;selectWeek&#8217;.)</p>
<pre class="brush: jscript; title: ; notranslate">
 d = d.addDays(- ((d.getDay() - Date.firstDayOfWeek + 7) % 7) + 6);
</pre>
<p>so it looks like:</p>
<pre class="brush: jscript; title: ; notranslate">
			setSelected : function(d, v, moveToMonth, dispatchEvents)
{
	if (d &amp;amp;lt; this.startDate || d.zeroTime() &amp;amp;gt; this.endDate.zeroTime()) {
		// Don't allow people to select dates outside range...
		return;
	}
	var s = this.settings;
	if (s.selectWeek)
	{
		d = d.addDays(- ((d.getDay() - Date.firstDayOfWeek + 7) % 7) + 6);
		if (d &amp;amp;lt; this.startDate) // The first day of this week is before the start date so is unselectable...
		{
			return;
		}
	}
</pre>
]]></content:encoded>
			<wfw:commentRss>http://ashleybaker.co.uk/making-kevin-lucks-jquery-datepicker-library-select-the-last-day-of-the-week/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

