
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

datef is a Javascript date formatting library, both for browser and node.js.
.noConflict method in case no module system is present (e.g. plain browser environment)Node.js
npm install datef
var datef = require('datef');
datef('MM.YYYY');
Require.js
require.config({
paths: {
'datef': 'path/to/datef'
}
})
require(['datef'], function(datef){
datef('MM.YYYY');
});
Browser
<script src="datef.js"></script>
<script>
datef('MM.YYYY');
</script>
datef('dd.MM.YY', new Date()); // "13.08.13"
datef('dd.MM.YY'); // second argument is optional; datef takes Date.now() if no date is provided
var d = new Date();
d.setFullYear(2045);
datef('dd.MM.YYYY', d); // "13.08.2045"
Node.js
datef.lang('ru');
datef('dd MMMM'); // 13 августа
Require.js
require.config({
paths: {
'datef': 'path/to/datef',
'datef_ru': 'path/to/datef_lang/ru'
}
})
require(['datef', 'datef_ru'], function(datef){
datef.lang('ru');
datef('dd MMMM'); // 13 августа
});
Browser
<script src="datef.js"></script>
<script src="lang/ru.js"></script>
<script>
datef.lang('ru');
datef('dd MMMM'); // 13 августа
</script>
// predefined formats
datef.formatters(); // ['ISODate','ISOTime','ISODateTime','ISODateTimeTZ']
datef('ISODateTimeTZ', d); // "2013-08-13T15:01:29 -04:00"
// defining your own simple format
datef.register('myFormat', 'd.M.YY');
datef('myFormat', d); // "13.8.13"
// defining your own format with i10n
datef.register('myI10nFormat', {
'en': 'MMMM dd, DD',
'ru': 'DD, dd MMMM',
'default': 'dd MMMM'
});
datef('myI10nFormat', d); // "August 13, Tuesday"
datef.lang('ru');
datef('myI10nFormat', d); // "Вторник, 13 августа"
datef.lang('uk');
datef('myI10nFormat', d); // "13 жніўня"
This is similar to Backbone.noConflict()
<script>var datef = 'My very important data';</script>
…
<script src="datef.js"></script>
<script>
console.log(typeof datef); // "function"
var formattingLib = datef.noConflict();
console.log(datef); // 'My very important data'
</script>
Full list of tokens possible in format string include:
FAQs
Simple date formatting library with i10n, both for browser and node.js
The npm package datef receives a total of 151 weekly downloads. As such, datef popularity was classified as not popular.
We found that datef 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.