Bergrebell / CyberCoach

1 stars 1 forks source link

wrong id for entry_date property in view: [runnings/boxings/soccers/cyclings]/new.html.erb #60

Closed lexruee closed 9 years ago

lexruee commented 9 years ago

The following views are affected:

<input type="datetime" name="date" id="datepicker">

This line breaks the controller method create, because property entry_date is always nil.

So the above html line should be changed as follows:

<input type="datetime" name="date" id="entry_date">

To integrate the date picker use the html class property:

<input type="datetime" name="date" class="datepicker" id="entry_date">

So application.js must be changed as follows ($(".datepicker") instead of $("#datepicker")):

1) Version using jquery UI date picker

 $(function (){
        var dateInput = $(".datepicker"); // in html => class="datepicker"
        var format = 'yy-mm-dd';
        dateInput.datepicker({dateFormat: format});
    });

2) Version using ukit date picker

$(function (){
    var dateInput = $(".datepicker");
    $.UIkit.datepicker(dateInput,{format: 'YYYY-MM-DD'})
});

Me and Stefan would suggest to use the second version.

See:

This issue fixes also issue #59.

wanze commented 9 years ago

Just a small note: Maybe we could use the datepicker from UIKit, it looks more consitent with the UI? :) http://getuikit.com/docs/addons_datepicker.html

lexruee commented 9 years ago

@wanze You're the UI chief :-)

In that case application.js must be changed as follows:

$(function (){
    var dateInput = $(".datepicker");
    $.UIkit.datepicker(dateInput,{format: 'YYYY-MM-DD'})
});
svetakrasikova commented 9 years ago

Sure, we should use the "right" datepicker! I overlooked it, thought there was no datepicker function in UIKit. I'll try to fix things right away.

14 Nov 2014, в 00:19, Stefan Wanzenried notifications@github.com написал(а):

Just a small note: Maybe we could use the datepicker from UIKit, it looks more consitent with the UI? :) http://getuikit.com/docs/addons_datepicker.html

— Reply to this email directly or view it on GitHub.

lexruee commented 9 years ago

@svetakrasikova I hope it doesn't bother you that this issue is assigned to you. Sry that me and Stefan are a little bit picky :-).

svetakrasikova commented 9 years ago

Not all :) It's good that this came up and I can do this. Let me know if I can do something else (without danger of messing up too much:) 14 Nov 2014, в 10:23, Alexander Rüedlinger notifications@github.com написал(а):

@svetakrasikova I hope it doesn't bother you that this issue is assigned to you. Sry that me and Stefan are a little bit picky :-).

— Reply to this email directly or view it on GitHub.

svetakrasikova commented 9 years ago

I've replaced the datepicker. it should be fine now. Alex, you are doing everything and just let me copy/paste :) And then you are telling me that you are picky ... no comment. Thank you for the links, was instructive.

lexruee commented 9 years ago

@svetakrasikova Sorry, I'm a real scrum pig :-). I know that's not a nice way to let you do things by doing copy / paste stuff. If this issue is fixed I suggest you can close it :-).