leonidas / transparency

Transparency is a semantic template engine for the browser. It maps JSON objects to DOM elements by id, class and data-bind attributes.
http://leonidas.github.com/transparency/
MIT License
969 stars 112 forks source link

Binding to input field with type='date' doesn't work in Chrome #76

Closed ghost closed 12 years ago

ghost commented 12 years ago

Chrome lets you put type='date' on an input field and the browser will show native date picker.

When you try to bind JavaScript object to the input field with type='date' no value fills in. When you remove type='date' from the form field everything works fine.

I'm using the jQuery plugin of transparency (jQuery 1.8.2).

<form class='bug_test'>
    <input type="date" id="date_type"/>
    <input id="no_type"/>
</form>
$(function() {
    $('.bug_test').render({ 
        date_type: '10/12/2011',
        no_type: '10/12/2011'
    });
});

I actually tried both regular String and Date object to bind to field.

ghost commented 12 years ago

Trying to set the value of the field with jQuery alone doesn't work, either a bug with Chrome or jQuery... Closing this out.

ghost commented 12 years ago

Alright so here is the real problem...

"When setting the input.value programmatically, the value accepts only yyyy-mm-dd style regardless of the presentation format for both the initial value and the JavaScript injected value."