Is there a way to do a preprocessing of the field before generating the object?
For example:
proto.MyType.toObject = function(includeInstance, msg) {
var f, obj = {
nextPaymentDay: new Date(jspb.Message.getFieldWithDefault(msg, 47, "")).toLocaleDateString() ,
}
}
It takes a timeStamp and convert in a Date String.
The idea is not to have to convert the field in every place It have to be used.
Of course I can change the _pb.js but it's rewritten everytime I make a change.
Is there a way to do a preprocessing of the field before generating the object? For example: proto.MyType.toObject = function(includeInstance, msg) { var f, obj = { nextPaymentDay: new Date(jspb.Message.getFieldWithDefault(msg, 47, "")).toLocaleDateString() , } } It takes a timeStamp and convert in a Date String. The idea is not to have to convert the field in every place It have to be used.
Of course I can change the _pb.js but it's rewritten everytime I make a change.