
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
ampersand-state-mixin-datatype-iso-date
Advanced tools
Adds a date datatype to ampersand-state using ISO 8601 locale strings
Adds ISO 8601 date functionality to ampersand state. This module stores dates explicity as full ISO 8601 strings with client locale TZ. This makes all timestamps lossless, vs using UTC ISO stamps or Unix time (epoch) values.
// same time, different formats
"2015-07-04T15:26:19-07:00" // good! lossless timestamp data, keeping client TZ. we use this
"2015-07-04T22:26:19.000Z" // poor! UTC normalized. drops user TZ
1436048779 // poor! unix time, UTC normalized (maybe!*). drops user TZ
You may want to specify something like the following in your ampersand-states or ampersand-models:
var State = require('ampersand-state');
var DateState = State.extend(isoDateMixin, {
props: {
sometime: 'iso-date'
}
});
Using the example from above
var State = require('ampersand-state');
var funcMixin = require('ampersand-state-mixin-datatype-iso-date');
var DateState = State.extend(funcMixin, {
props: {
sometime: {
type: 'iso-date',
required: true
}
}
});
var model = new DateState({
myTime: new Date()
});
model.myTime; //=> "2015-07-04T15:26:19-07:00"
model.myTime = "2015-07-04 16:30:20-07:00"; // no T is still ISO compliant. some DBs, like postgres, omit it by default
model.myTime; //=> "2015-07-04T16:30:20-07:00";
model.myTime = '10/10/2010'; // Using incomplete timestamps is deprecated in this module's moment.js dep, thus not recommended
model.myTime; //=> "2010-10-10T00:00:00-07:00" (caution!)
FAQs
Adds a date datatype to ampersand-state using ISO 8601 locale strings
We found that ampersand-state-mixin-datatype-iso-date demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.