@eeplatform/nuxt-layer-common 1.2.4 → 1.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/composables/useUtils.ts +7 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/composables/useUtils.ts
CHANGED
|
@@ -265,6 +265,12 @@ export default function useUtils() {
|
|
|
265
265
|
return params;
|
|
266
266
|
}
|
|
267
267
|
|
|
268
|
+
function toOrdinal(n: number): string {
|
|
269
|
+
const s = ["th", "st", "nd", "rd"];
|
|
270
|
+
const v = n % 100;
|
|
271
|
+
return n + (s[(v - 20) % 10] || s[v] || s[0]);
|
|
272
|
+
}
|
|
273
|
+
|
|
268
274
|
return {
|
|
269
275
|
requiredRule,
|
|
270
276
|
emailRule,
|
|
@@ -290,5 +296,6 @@ export default function useUtils() {
|
|
|
290
296
|
getRouteParam,
|
|
291
297
|
replaceMatch,
|
|
292
298
|
setRouteParams,
|
|
299
|
+
toOrdinal,
|
|
293
300
|
};
|
|
294
301
|
}
|