Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
date-format-lite
Advanced tools
@version 0.6.0
@date 2014-11-13
@stability 1 - Experimental
Lite version of Date format and parse for node.js and browser that extends native Date object.
<script src=date-format.js></script>
npm install date-format-lite
require("date-format-lite")
// Format
var now = new Date() // Date {Wed Jul 10 2013 16:47:36 GMT+0300 (EEST)}
now.format("isoUtcDateTime") // 2013-07-10T13:47:36Z
now.format("hh:mm") // 16:47
now.format("UTC:hh:mm") // 13:47
// Parse
"2013-07-10".date() // Date {Wed Jul 10 2013 03:00:00 GMT+0300 (EEST)}
"2013-07-10T13:47:36Z".date() // Date {Wed Jul 10 2013 16:47:36 GMT+0300 (EEST)}
"10/07/2013".date() // Date {Wed Jul 10 2013 03:00:00 GMT+0300 (EEST)}
Date.middleEndian = true
"10/07/2013".date() // Date {Mon Oct 07 2013 03:00:00 GMT+0300 (EEST)}
// Change format
"10/07/2013".date("YYYY-MM-DD")// 2013-07-10
Date.masks.default = 'YYYY-MM-DD hh:mm:ss'
now.format() // 2013-07-10 13:47:36
Date.masks.my = '"DayNo "D'
now.format("my") // DayNo 10
// Add to estonian-lang.js
Date.dayNames = "P E T K N R L pühapäev esmaspäev teisipäev kolmapäev neljapäev reede laupäev".split(" ")
Date.monthNames = "Jaan Veeb Märts Apr Mai Juuni Juuli Aug Sept Okt Nov Dets jaanuar veebruar märts aprill mai juuni juuli august september oktoober november detsember".split(" ")
// Change AM and PM
Date.am = "a.m."
Date.pm = "p.m."
See tests for more examples
It should work IE6 and up but automated testing is currently broken.
Copyright (c) 2012-2014 Lauri Rooden <lauri@rooden.ee>
The MIT License
FAQs
A small library for parsing and formatting dates
We found that date-format-lite 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
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.