electricessence / TypeScript.NET

A JavaScript-Friendly .NET Based TypeScript Library (Moved)
https://github.com/electricessence/TypeScript.NET-Core
Other
251 stars 36 forks source link

DateTime format #57

Open oleksandrmelnychenko opened 7 years ago

oleksandrmelnychenko commented 7 years ago

Do we have possibilities to change date time format as 'dd-mmm-yyy' for example ?

electricessence commented 7 years ago

There is currently nothing built in yet that would facilitate 'formatting' like .NET has. :( That was a huge endeavor that I deferred. There are string formatting utilities added so you could:

supplant("{day}-{month}-{year}",myDateTime.calendar())

But that wouldn't do any digit manipulation nor would it convert to a localized naming convention for the months. :(

electricessence commented 7 years ago

There is also a .NET analog for Regex that allows for named matches and MatchEvaluators so that could also be used as a foundation.