Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
rd_unobtrusive_date_picker
Advanced tools
= Unobtrusive Date-Picker Widget Plugin
This is a helper for creating a date or date-time picker that uses the
Unobtrusive Date-Picker Widget(sic)
(http://www.frequency-decoder.com/2006/10/02/unobtrusive-date-picker-widgit-update)
to add a clickable calendar image that will bring up a calendar picker if
javascript is available. It replicates as much of the API of the Rails
date_select
, and datetime_select
form helpers.
It also uses the 12 Hour Time plugin (http://code.google.com/p/rails-twelve-hour-time-plugin/) so that 12 Hour times can be processed by Active Record.
You may want to consider compressing the javascript files with Dean Edward's Packer (http://dean.edwards.name/packer/) or Douglas Crockford's JSMin (http://www.crockford.com/javascript/jsmin.html) before deploying your application.
== Install
script/plugin install git://github.com/brianjlandau/unobtrusive_date_picker.git
== Usage
To be able to use the date-picker methods below you need to include the
javascript library file and CSS stylesheet in the of your layout
template. You can do this either by manually including the files via a
javascript_include_tag
and a stylesheet_link_tag
(the files are both named
"datepicker"), OR by using the included unobtrusive_datepicker_includes
helper
method, which will do this for you.
There are 4 main methods:
Options (* indicates same functionality as is in Rails Date helpers):
The unobtrusive_date_text_picker
and unobtrusive_date_text_picker_tag
methods
don't except the ":order", ":include_blank", ":start_year", ":end_year", ":minute_step", ":use_short_month",
":use_month_numbers", and ":add_month_numbers" options.
It does use these options though:
==== RJS Method
There is an additional RJS method to re initialize the Date Pickers when an AJAX response is supplied to the client:
==== Rake task
There is also a rake task that can be executed by running rake datepicker:update
in your Rails apps root directory. This task will update your
datepicker javascripts, stylesheets, and images. This is useful if you are using
an old version of the plugin that had an older version of the Unobtrusive
Date-Picker Widget Javascript library, or in the future when new version are
release and I update the plugin with them.
=== Example: <% form_for :article, :url => { :action => @form_action, :id => @article } do |f| %>
... Date: <%= f.unobtrusive_datetime_picker :date %>=== Produces (Current date when output: 12/6/07):
<label>Date:
<select id="article_date-dd" name="article[date(3i)]">
<option value="1">1</option>
...
<option value="31">31</option>
</select>
<select id="article_date-mm" name="article[date(2i)]">
<option value="1">January</option>
...
<option value="12" selected="selected">December</option>
</select>
<select id="article_date" name="article[date(1i)]" class="split-date">
<option value="2002">2002</option>
...
<option value="2012">2012</option>
</select>
<select id="article_date_4i" name="article[date(4i)][hour]">
<option value="1">1</option>
...
<option value="12">12</option>
</select>
:
<select id="article_date_5i" name="article[date(5i)][minute]">
<option value="00">00</option>
...
<option value="59">59</option>
</select>
<select id="article_date_6i" name="article[date(6i)][ampm]">
<option value="AMPM>AMPM</option>
<option value="AMPM>AMPM</option>
</select>
</label><br />
</fieldset>
== LICENSE
See MIT-LICENSE file for copyright and licensing information for this plugin.
Unobtrusive Date-Picker Widget is provided under the Creative Commons Attribution-ShareAlike 2.5 license (http://creativecommons.org/licenses/by-sa/2.5/) by frequency-decoder.com
FAQs
Unknown package
We found that rd_unobtrusive_date_picker demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.