Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
md-date-time-picker-rails
Advanced tools
md-date-time-picker-rails gem is the integration of md-date-time-picker javascript library(using 2.2 Version) for your Rails 4, 5 application.
md-date-time-picker is Material Design - Date and Time Picker source: https://github.com/PuranjayJain/md-date-time-picker
Ruby gems url: https://rubygems.org/gems/md-date-time-picker-rails
Add this line to your application's Gemfile:
gem 'md-date-time-picker-rails'
And then execute:
$ bundle
Or install it yourself as:
$ gem install md-date-time-picker-rails
Now you need to edit your app/assets/javascripts/application.js
file
and add the following line:
//= require moment.min
//= require moment.locales# if using another locale
//= require draggabilly.pkgd.min # If using TimeDialog
//= require mdDateTimePicker
And you need to edit your app/assets/stylesheets/application.css
file
and add the following line:
*= require mdDateTimePicker
If Use app/assets/stylesheets/application.scss
file
@import "mdDateTimePicker";
mdDateTimePicker provided prebuilt themes
This Gem progressively support all Themes
If you apply theme, you need to edit your app/assets/stylesheets/application.scss
or app/assets/stylesheets/application.scss
file
and change the following line:
# app/assets/stylesheets/application.css
*= require themes/dark/amber/mdDateTimePicker
# app/assets/stylesheets/application.scss
@import "themes/dark/amber/mdDateTimePicker";
Currently, Support Theme List
themes/dark/amber
, themes/dark/blue
, themes/dark/blue-grey
, themes/dark/cyan
, themes/dark/deep-orange
, themes/dark/deep-purple
, themes/dark/green
, themes/dark/grey
,themes/dark/indigo
, themes/dark/light-blue
, themes/dark/light-green
, themes/dark/lime
, themes/dark/orange
, themes/dark/pink
, themes/dark/purple
, themes/dark/red
, themes/dark/teal
, themes/dark/yellow
themes/light/amber
, themes/light/blue
, themes/light/blue-grey
, themes/light/cyan
, themes/light/deep-orange
, themes/light/deep-purple
, themes/light/green
, themes/light/grey
,themes/light/indigo
, themes/light/light-blue
, themes/light/light-green
, themes/light/lime
, themes/light/orange
, themes/light/pink
, themes/light/purple
, themes/light/red
, themes/light/teal
, themes/light/yellow
Here is the example working code to test with your Rails application.
Add this sample code to your app/assets/javascripts/application.js
file
$(document).ready(function(){
toggleButton = document.getElementById("OBJECT_ID");
dialog = new mdDateTimePicker["default"]({
type: 'date',
type: 'time', # If you wanna TIME
future: moment().add(1, 'years'), # Optional
trigger: toggleButton # Optional
});
toggleButton.addEventListener("click", function() {
return dialog.toggle();
});
toggleButton.addEventListener("onOk", function(e) {
return this.value = dialog.time().format('L');
});
});
If use app/assets/javascript/application.coffee
toggleButton = document.getElementById("OBJECT_ID")
dialog = new mdDateTimePicker.default(
type: 'date',
future: moment().add(1, 'years'),
trigger: toggleButton
)
toggleButton.addEventListener "click", ->
dialog.toggle()
toggleButton.addEventListener "onOk", (e) ->
this.value = dialog.time.format('L')
The Documentation is at https://puranjayjain.github.io/md-date-time-picker
git checkout -b my-new-feature
)git commit -am 'Added some feature'
)git push origin my-new-feature
)The gem is available as open source under the terms of the MIT License.
FAQs
Unknown package
We found that md-date-time-picker-rails 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.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.