This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Tambaqui.Extensions; | |
... | |
namespace Tambaqui | |
{ | |
public class Startup | |
{ | |
public Startup(IConfiguration configuration) | |
{ | |
Configuration = configuration; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System.Globalization; | |
using Microsoft.AspNetCore.Builder; | |
using Microsoft.AspNetCore.Localization; | |
namespace Tambaqui.Extensions | |
{ | |
public static class AppExtensions | |
{ | |
public static IApplicationBuilder UsarCulturaBrasileira(this IApplicationBuilder app){ | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Substitui o ponto pela virgula ao validar inputs decimais. Muito adequado para inputs de valor monetário. | |
$.validator.methods.range = function (value, element, param) { | |
var globalizedValue = value.replace(",", "."); | |
return this.optional(element) || (globalizedValue >= param[0] && globalizedValue <= param[1]); | |
}; | |
$.validator.methods.number = function (value, element) { | |
return this.optional(element) || /^-?(?:\d+|\d{1,3}(?:[\s\.,]\d{3})+)(?:[\.,]\d+)?$/.test(value); | |
}; |