Checking if helpers are not registered before register to avoid overriding
This commit is contained in:
parent
66df591166
commit
a8ee17dc71
@ -17,6 +17,9 @@ const formatDA = (context, format, options) => {
|
||||
return dateAsMoment.format(strFormat);
|
||||
};
|
||||
|
||||
Blaze.registerHelper('formatDA', formatDA);
|
||||
// Check if global helper already exists to not override it
|
||||
if (!Blaze._getGlobalHelper('formatDA')) {
|
||||
Blaze.registerHelper('formatDA', formatDA);
|
||||
}
|
||||
|
||||
export { formatDA };
|
||||
|
||||
@ -12,6 +12,10 @@ const formatPN = context => {
|
||||
/**
|
||||
* A global Blaze UI helper to format a patient name for display purposes
|
||||
*/
|
||||
Blaze.registerHelper('formatPN', formatPN);
|
||||
|
||||
// Check if global helper already exists to not override it
|
||||
if (!Blaze._getGlobalHelper('formatPN')) {
|
||||
Blaze.registerHelper('formatPN', formatPN);
|
||||
}
|
||||
|
||||
export { formatPN };
|
||||
|
||||
@ -27,6 +27,9 @@ const formatTM = (context, options) => {
|
||||
return dateTime.format(format);
|
||||
};
|
||||
|
||||
Blaze.registerHelper('formatTM', formatTM);
|
||||
// Check if global helper already exists to not override it
|
||||
if (!Blaze._getGlobalHelper('formatTM')) {
|
||||
Blaze.registerHelper('formatTM', formatTM);
|
||||
}
|
||||
|
||||
export { formatTM };
|
||||
|
||||
Loading…
Reference in New Issue
Block a user