A simple wrapper to use Google libphonenumber inside Thymeleaf
compile "ch.itds.taglib:phonenumber-thymeleaf-taglib:1.0.1"
import ch.itds.taglib.phonenumber.PhoneNumberDialect;
@Bean
public PhoneNumberDialect phoneNumberDialect() {
return new PhoneNumberDialect();
}
<a th:href="|tel:${#phoneNumber.format('044 111 22 33', 'CH', 'E164')}|"
th:text="${#phoneNumber.format('044 111 22 33', 'CH', 'NATIONAL')}"></a>