Codepen code of date string example
For #30
Fix the codepen example and add can.serialize
symbol to DateStringSet
type and can.new
to DateString
type:
class DateStringSet {
constructor(value){
this.value = value;
}
// used to convert to a number
valueOf(){
return new Date(this.value).getTime();
}
[Symbol.for("can.serialize")](){
return this.value;
}
}
const DateString = {
[Symbol.for("can.new")]: function(v){ return v; },
[Symbol.for("can.SetType")]: DateStringSet
};