Finish plantings javascript

@Marlena and I paired on a couple of stories related to marking a planting finished.

+ [First story](https://www.pivotaltracker.com/n/projects/646869/stories/78752894): Clear out the `finished_at` input field when marking a planting finished. The date is cached (as long as the user is on the page) in case the planting is re-marked finished. 

+ [Second story](https://www.pivotaltracker.com/n/projects/646869/stories/78753350): Show a datepicker to indicate the `finished_at` date when marking a planting finished on the planting show page.

For the first story we thought about auto-populating the `finished_at` input field with some arbitrary date like today's date when the planting is marked finished. But then we thought this might be unnecessarily complicated, so we're throwing it out there for general discussion. 
Ah, I see. In that case, I think we should be consistent with how things
are done elsewhere, and leave the $(link).click() in.

On Wed, Oct 15, 2014 at 2:16 AM, Taylor Griffin <notifications@github.com>
wrote:

> In app/assets/javascripts/append_date.js.coffee:
>
> > +  el = $('.append-date')
> > +
> > +  el.datepicker({'format': 'yyyy-mm-dd'})
> > +
> > +  el.click (e) ->
> > +    e.stopPropagation()
> > +    e.preventDefault()
> > +
> > +  el.one 'changeDate', ->
> > +    href = $(this).attr('href')
> > +    date = $(this).datepicker('getDate')
> > +    url  = "#{href}&planting[finished_at]=#{date}"
> > +
> > +    link = $("<a href='#{url}' data-method='put'></a>")
> > +    $('body').append(link)
> > +    $(link).click()
>
> Right. Sorry, what I meant was that the error will be handled from
> beginning to end. With ajax, the script will have to consume a json error
> and then display the result. Actually, like I said, that's how I would
> normally do it in one of my projects, but when I implemented something
> similar in the autosuggest script, we ended up cutting it out. I didn't
> want to implement more than necessary this time around.
>
> So @pozorvlak <https://github.com/pozorvlak>, I guess you're voting to
> handle the errors in Javascript? I second. @Skud <https://github.com/Skud>,
> motion to adjourn?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/Growstuff/growstuff/pull/428/files#r18870426>.
>