-
Notifications
You must be signed in to change notification settings - Fork 0
RenderUtils
Erik C. Thauvin edited this page Nov 15, 2024
·
13 revisions
Most of the functionalities of this project's renderers are implemented in the rife.render.RenderUtils class.
Method | Description |
---|---|
abbreviate | Abbreviates a String to the given length using a replacement marker |
beatTime | Returns the Swatch Internet (.beat) Time for the give date-time |
capitalizeWords | Capitalizes words of a template value |
enodeJs | Encodes a String to JavaScript/ECMAScript |
fetchUrl | Fetches the content (body) of a URL |
formatCreditCard | Returns the last 4 digits a credit card number. The number must satisfy the Luhn algorithm. Non-digits are stripped from the number |
htmlEntities | Converts a text string to HTML decimal entities |
mask | Masks characters in a String |
normalize | Normalizes a String for inclusion in a URL path |
plural | Returns the plural form of a word, if count > 1 |
qrCode | Generates an SVG QR Code from the given String using goQR.me |
rot13 | Translates a String to/from ROT13 |
shortenUrl | Shortens a URL using is.gd. The URL string must be a valid http or https URL |
swapCase | Swaps the case of a String |
uptime | Returns the formatted server uptime |
validateCreditCard | Validates a credit card number using the Luhn algorithm |
Additional methods are provided directly by the rife.tools.StringUtils class
There are also date/time formatters for popular formats:
DateTimeFormatter | Description |
---|---|
ISO_8601_DATE_FORMATTER | ISO 8601 date formatter |
ISO_8601_FORMATTER | ISO 8601 date and time formatter |
ISO_8601_TIME_FORMATTER | ISO 8601 time formatter |
ISO_8601_YEAR_FORMATTER | ISO 8601 Year formatter |
RFC_2822_FORMATTER | RFC 2822 date and time formatter |