Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
= Wiser Date for Rails
WiserDate is a date formatting plugin written by Kenneth John Balgos (https://github.com/kennethjohnbalgos). Wiser Date features dynamic presentation of feed timestamps. The plugin now supports real-time and dynamic date displays.
== Dependency
Rails >=3.1 and jQuery >=1.7 to make the real-time feature work.
== Installation
Install the gem.
gem "wiser_date"
Require jquery.wiser_date in your app/assets/application.js file.
//= require jquery.wiser_date
== Usage
Use the wiser_date function in your views.
<%= wiser_date @user.last_login_at %>
# Sample display within few seconds: just now
# Sample display within few minutes: about 30 minutes ago
# Sample display within the day: about 3 hours ago
# Sample display later within the day: today at 12:21pm
# Sample display after the day: yesterday 12:21pm
# Sample display after 2 days: September 10, 2013 12:21pm
@user.last_login_at can be any timestamp you want to display.
Assume that the value is "Mon, 10 Sept 2012 12:21:16 UTC +00:00".
== Options & Examples
You can customize the behavior of the date display by using the following options:
real_time - toggles the real-time updating of displayed dates [default: true]
<%= wiser_date @user.last_login_at, :real_time => false %>
interval - custom real-time update interval in seconds [default: 20]
<%= wiser_date @user.last_login_at, :interval => 60 %>
date_format - overrides the default date format [default: "%b %d, %Y"]
<%= wiser_date @user.last_login_at, :date_format => "%Y-%m-%d" %>
time_format - overrides the default time format [default: "%l:%M%P"]
<%= wiser_date @user.last_login_at, :time_format => "%H:%M:%S" %>
humanize - converts date to more readable string [default: true]
<%= wiser_date @user.last_login_at, :humanize => false %>
time_first - displays time first instead of date [default: false]
<%= wiser_date @user.last_login_at, :time_first => true %>
hide_same_year - will not display the year if the it is the same with the present year [default: false]
<%= wiser_date @user.last_login_at, :hide_same_year => true %>
capitalize - capitalizes the first letter of the date displayed [default: true]
<%= wiser_date @user.last_login_at, :capitalize => true %>
custom_class - adds custom classes to the containter span of the date [default: nil]
<%= wiser_date @user.last_login_at, :custom_class => "date_tooltip" %>
time_now - accepts complete timestamp as the basis of time distances [default: server_time]
<%= wiser_date @user.last_login_at, :time_now => "2012-09-10 12:21:16 +0000" %>
== Support Open an issue in https://github.com/kennethjohnbalgos/wiser_date if you need further support or want to report a bug.
FAQs
Unknown package
We found that wiser_date 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
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.