You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
934 B
38 lines
934 B
2 years ago
|
"use strict";
|
||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||
|
var dateFormat_js_1 = require("../../miniprogram_npm/dai-mp/tools/dateFormat.js");
|
||
|
Component({
|
||
|
properties: {
|
||
|
format: {
|
||
|
type: String,
|
||
|
value: "yyyy-MM-dd",
|
||
|
},
|
||
|
timestamp: {
|
||
|
type: String,
|
||
|
value: "",
|
||
|
},
|
||
|
},
|
||
|
data: {
|
||
|
showText: "",
|
||
|
},
|
||
|
observers: {
|
||
|
timestamp: function (val) {
|
||
|
this.computeShowText();
|
||
|
},
|
||
|
},
|
||
|
lifetimes: {
|
||
|
ready: function () {
|
||
|
this.init();
|
||
|
},
|
||
|
},
|
||
|
methods: {
|
||
|
init: function () {
|
||
|
},
|
||
|
computeShowText: function () {
|
||
|
var _a = this.data, timestamp = _a.timestamp, format = _a.format;
|
||
|
var showText = dateFormat_js_1.default(new Date(timestamp * 1000), format);
|
||
|
this.setData({ showText: showText });
|
||
|
},
|
||
|
},
|
||
|
});
|