Comments (17)
I need a little bit help on your side.
- Are you using simple_form?
- Can you show view part for date/time?
from anjlab-widgets.
date/time elements generates on(2i), on(1i) and so on by default. You should pass rails: false in input_html options to disable that
from anjlab-widgets.
Sure!
I'm using simple_form and setup the initializer like so: Anjlab::Widgets.simple_form
here are my two fields. The fields in the db are a :string (varchar) not a :datetime.
<%= f.input :time, as: :anjlab_time, label: 'Event Start Time:' %>
<%= f.input :date, as: anjlab_date, label: 'Event Start Date:' %>
On Aug 5, 2013, at 11:03 AM, Yury Korolev [email protected] wrote:
I need a little bit help on your side.
Are you using simple_form?
Can you show view part for date/time?
—
Reply to this email directly or view it on GitHub.
from anjlab-widgets.
If I understand it correctly the fields should be as such:
<%= f.input :time, as: :anjlab_time, label: 'Event Start Time:', :input_html => {rails: false} %>
<%= f.input :date, as: :anjlab_date, label: 'Event Start Date:', :input_html => {rails: false} %>
from anjlab-widgets.
I was wrong…
For you, it is better to use plain strings
<%= f.input :time, as: :string, label: 'Event Start Time:', input_html: {data: {widget: 'timepicker'}, type: 'time'} %>
<%= f.input :date, as: :string, label: 'Event Start Date:', input_html: {data: {widget: 'datepicker'}, type: 'date'} %>
from anjlab-widgets.
I can see it is putting rails: false in, but I still get the error.
input class="anjlab_time optional" data-rails="true" data-widget="timepicker" id="event_time" name="event[time]" rails="false" size="30" type="text" value="" data-validate="true"
from anjlab-widgets.
Well that is working for the time selection, but not the date. When using the date selection I can see the MM/DD/YYYY placeholder, but when I select a date from the drop down calendar, it doesn't actually update the placeholder with the new input.
from anjlab-widgets.
that with as: :string
?
from anjlab-widgets.
Yep, as this:
<%= f.input :date, as: :string, label: 'Event Start Date:', input_html: {data: {widget: 'datepicker'}, type: 'date'} %>
from anjlab-widgets.
Do you lang attribute in your html tag?
from anjlab-widgets.
I'm not quite sure what you mean. I'm new to Rails, just building something to teach myself.
I'm assuming you mean does my tag look like this at the top of application.html.erb:
html lang="en"
Is that right?
from anjlab-widgets.
Yep, in html document it should be like
<html lang='en'>….
Trying to reproduce…. without luck...
from anjlab-widgets.
Don't know if they will help any, but it's a quick screencast of the problem.
On Aug 5, 2013, at 1:28 PM, Yury Korolev [email protected] wrote:
Yep, in html document it should be like
….Trying to reproduce…. without luck...
—
Reply to this email directly or view it on GitHub.
from anjlab-widgets.
Yep, video does help a lot.
for now please use type text for your date/time inputs
<%= f.input :date, as: :string, label: 'Event Start Date:', input_html: {data: {widget: 'datepicker'}, type: 'text'} %>
from anjlab-widgets.
Thanks for the help! I haven't been able to get a time picker or date picker working (and I tried the bootstrap-rails-timepicker/datepicker gem) for over a month now!
I'm not quite sure what is happening in the data-widget stuff, but thanks! Hopefully I helped you some also with the gem ;)
from anjlab-widgets.
Wait a moment….
Are you still using anjlab-widgets pickers and they work or you switched to bootstrap-rails-timepicker?
Sorry my bad english :(
from anjlab-widgets.
Your English is just fine :)
I am still using anjlab-widgets. The bootstrap-rails-timepicker would not work, so I switched to anjlabs :)
from anjlab-widgets.
Related Issues (17)
- date picker only works for DateTime objects, not Dates
- uninitialized constant Anjlab HOT 6
- Bootstrap 3 HOT 2
- 24 Hour vs. AM/PM HOT 3
- Undefined variable: "$border-radius-base". HOT 18
- Locale problem HOT 6
- October month broken
- Ugly scrollbar on time picker
- License missing from gemspec
- Limit date
- How to set local?
- How to set locale to dd/mm/yy ?
- I'm using Castify https://play.google.com/store/apps/details?id=com.castify to watch web videos! Help me get credit for inviting you here at: http://castify.tv/invite/D9MOVJK HOT 1
- Highlight current date in date picker
- Use time and datepicker to format to strings HOT 1
- Date Picker Prev/Next Year doesn;t work HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from anjlab-widgets.