
Security News
TypeScript is Porting Its Compiler to Go for 10x Faster Builds
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
@date-js/date-formatter
Advanced tools
DateFormatter.format('%l %j %F %Y', new Date());
// Sunday 12 October 2014
DateFormatter.format('%l %j %F %Y', new Date(), 'fr_FR');
// Samedi 12 octobre 2014
By default, Date Formatter uses the current browser language. You can force a locale like this:
DateFormatter.setLocale('fr-FR');
You can see examples in example directory.
npm install @date-js/date-formatter --save
import DateFormatter from '@date-js/date-formatter';
<script src="https://cdn.jsdelivr.net/npm/@date-js/date-formatter@1.0/dist/date-formatter.js"></script>
Character | Description | Example |
---|---|---|
%Y | A full numeric representation of a year, 4 digits | 2020 |
%y | A two digit representation of a year | 20 |
%d | Day of the month, 2 digits with leading zeros | 01 to 31 |
%l | A full textual representation of the day of the week | Sunday through Saturday |
%D | A textual representation of a day, three letters | Mon through Sun |
%F | A full textual representation of a month, such as January or March | January through December |
%M | A short textual representation of a month, three letters | Jan through Dec |
%m | Numeric representation of a month, with leading zeros | 01 through 12 |
%n | Numeric representation of a month, without leading zeros | 1 through 12 |
%G | 24-hour format of an hour without leading zeros | 0 through 23 |
%H | 24-hour format of an hour with leading zeros | 00 through 23 |
%i | Minutes with leading zeros | 00 to 59 |
%s | Seconds with leading zeros | 00 to 59 |
FAQs
A light javascript tool for formatting date.
The npm package @date-js/date-formatter receives a total of 4 weekly downloads. As such, @date-js/date-formatter popularity was classified as not popular.
We found that @date-js/date-formatter 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
TypeScript is porting its compiler to Go, delivering 10x faster builds, lower memory usage, and improved editor performance for a smoother developer experience.
Research
Security News
The Socket Research Team has discovered six new malicious npm packages linked to North Korea’s Lazarus Group, designed to steal credentials and deploy backdoors.
Security News
Socket CEO Feross Aboukhadijeh discusses the open web, open source security, and how Socket tackles software supply chain attacks on The Pair Program podcast.