moment.js
2.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
var moment = require('moment');
module.exports = function(Moment) {
Moment.disableRemoteMethod("create", true);
Moment.disableRemoteMethod("upsert", true);
Moment.disableRemoteMethod("updateAll", true);
Moment.disableRemoteMethod("updateAttributes", false);
Moment.disableRemoteMethod("find", true);
Moment.disableRemoteMethod("findById", true);
Moment.disableRemoteMethod("findOne", true);
Moment.disableRemoteMethod("deleteById", true);
Moment.disableRemoteMethod("confirm", true);
Moment.disableRemoteMethod("count", true);
Moment.disableRemoteMethod("exists", true);
Moment.disableRemoteMethod("resetPassword", true);
Moment.disableRemoteMethod('__count__accessTokens', false);
Moment.disableRemoteMethod('__create__accessTokens', false);
Moment.disableRemoteMethod('__delete__accessTokens', false);
Moment.disableRemoteMethod('__destroyById__accessTokens', false);
Moment.disableRemoteMethod('__findById__accessTokens', false);
Moment.disableRemoteMethod('__get__accessTokens', false);
Moment.disableRemoteMethod('__updateById__accessTokens', false);
Moment.disableRemoteMethod('create', true); // Removes (POST) /products
Moment.disableRemoteMethod('upsert', true); // Removes (PUT) /products
Moment.disableRemoteMethod('deleteById', true); // Removes (DELETE) /products/:id
Moment.disableRemoteMethod("updateAll", true); // Removes (POST) /products/update
Moment.disableRemoteMethod("updateAttributes", false); // Removes (PUT) /products/:id
Moment.disableRemoteMethod('createChangeStream', true); // removes (GET|POST) /products/change-stream
Moment.Moment = function(cb){
var this_time = {
"docs":"http://momentjs.com/docs/",
"default": moment().format(),
"DD-MM-YYYY":moment().format("DD-MM-YYYY"),
"HH:MM:SS":moment().format("HH:mm:ss"),
"DDMMYYYY":moment().format("DDMMYYYY"),
"DD-MM-YYYY HH:II::SS":moment().format("DD-MM-YYYY HH:mm:ss"),
"YYYYMMDD-HHmmssSSS":moment().format("YYYYMMDD-HHmmssSSS")
};
cb(null,this_time);
};
Moment.remoteMethod('Moment',{
http:{path:'/Moment',verb:'get'},
returns: {arg: 'data', type: 'object', root: true}
})
};