nay / flexible_date Goto Github PK
View Code? Open in Web Editor NEWA rails plugin to provide the better handling of date atributes, especially for validation.
License: MIT License
A rails plugin to provide the better handling of date atributes, especially for validation.
License: MIT License
FlexibleDate ============ FlexibleDate plugin provides the better handling of date columns. With flexible_date_select helper, you can receive invalid data such as {:year => '2010', :month => '', :day => '3'} and validate it automatically, while you can also keep that value for the edit/new view to show the user what is wrong. You can get the string value such as '2009-01-01' if you specify the options to flexible_date_column. (But this plugin does not provide the helper for the string.) This plugin has been tested on Rails 2.3.3. Example ======= It your model class which has the target date column, you can write like this; class YourModel < ActiveRecord::Base flexible_date_column :started_on # You have started_on column which represents a date. end This will add some methods to you model class, some of them are used as callback methods, so that you can set a hash to started_on. Note that this hash must be able to respond to symbol keys. On the view side, you can use flexible_date_select instead of date_select. This helper holds invalid date values so that the user can see what is wrong. This plugin does not support non-builder type helper now, but there is a plan to add it later (or please add it). <% form_for :your_model do |f| %> <%= f.flexible_date_select :started_on %> <% end %> Copyright (c) 2010 nay3 (Yasuko Ohba), released under the MIT license
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.