Socket
Book a DemoInstallSign in
Socket

usertime-rails

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

usertime-rails

0.1.3
bundlerRubygems
Version published
Maintainers
1
Created
Source

usertime-rails

Build Status Coverage Status

A jQuery plugin provides to display time in user's timezone. (See usertime.js)

Dependencies

usertime.js requires moment.js library, please add this library first.

Installation

Add this line to your application's Gemfile:

gem 'usertime-rails'

And then execute:

bundle

Or install it yourself as:

gem install usertime-rails

Usage

Require Javascript

Add the following to /app/assets/javascripts/application.js:

//= require usertime

Helpers

You can use usertime_tag to wrap Time objects.

usertime_tag(Time.now)

It will output:

<usertime>1441099707000</usertime>

You can specify format:

usertime_tag(Time.now, :format => 'lll')

Output:

<usertime format="lll">1441099707000</usertime>

Notice this format is moment.format, not ruby format.

License

The gem is available as open source under the terms of the MIT License.

Contact

The project's website is located at https://github.com/emn178/usertime-rails
Author: Chen, Yi-Cyuan (emn178@gmail.com)

FAQs

Package last updated on 25 Aug 2016

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.