1

想实现datetime 是一段时间, 或者指定时间自增长 这样的数据我该如何配置?

require(['mock','jquery'],function(Mock,$){
     var data = Mock.mock({
        'list|10': [{
            'value' : 1,
            'name' : '@DATETIME("yyyy-MM-dd HH:mm:ss")',
            'category':'@TITLE(1)'
        }]
     });

     var json  =JSON.stringify(data, null, 4);
     console.log(data.list)
     $('<pre>').text(json).appendTo('body')
})

输出结果目前是


    "list": [
        {
            "value": 1,
            "name": "2008-10-12 11:39:01",
            "category": "Kisxuicwl"
        },
        {
            "value": 1,
            "name": "2014-02-15 12:18:37",
            "category": "Qjin"
        },
        {
            "value": 1,
            "name": "2000-07-03 08:02:18",
            "category": "Qjige"
        },
        {
            "value": 1,
            "name": "2007-09-29 03:19:51",
            "category": "Fwuerpj"
        },
        {
            "value": 1,
            "name": "2003-12-05 03:55:22",
            "category": "Tjgofviend"
        },
        {
            "value": 1,
            "name": "1973-01-18 13:06:09",
            "category": "Ccewmmt"
        },
        {
            "value": 1,
            "name": "1992-12-16 14:08:16",
            "category": "Qxpy"
        },
        {
            "value": 1,
            "name": "1986-01-02 09:21:53",
            "category": "Nbll"
        },
        {
            "value": 1,
            "name": "1983-07-17 17:53:25",
            "category": "Wzxkltezo"
        },
        {
            "value": 1,
            "name": "2012-06-13 03:57:05",
            "category": "Emzbm"
        }
    ]
}
夜聆风 1.3k
2015-11-18 提问

查看全部 3 个回答

1

@now(yyyy-MM-dd) @increment(1):00:00

推广链接