Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sbytedev/net.mvvmcross.plugins.datetimeconverter
A set of date and time converters.
https://github.com/sbytedev/net.mvvmcross.plugins.datetimeconverter
c-sharp date-formatting mvvmcross plugin xamarin
Last synced: about 1 month ago
JSON representation
A set of date and time converters.
- Host: GitHub
- URL: https://github.com/sbytedev/net.mvvmcross.plugins.datetimeconverter
- Owner: sbytedev
- License: mit
- Created: 2020-01-18T11:11:43.000Z (about 5 years ago)
- Default Branch: develop
- Last Pushed: 2022-12-01T11:00:55.000Z (about 2 years ago)
- Last Synced: 2024-12-01T13:54:14.534Z (about 2 months ago)
- Topics: c-sharp, date-formatting, mvvmcross, plugin, xamarin
- Language: C#
- Homepage:
- Size: 170 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MvvmCross DateTimeConverter Plugin
![GitHub](https://img.shields.io/github/license/SByteDev/Net.MvvmCross.Plugins.DateTimeConverter.svg)
![Nuget](https://img.shields.io/nuget/v/SByteDev.MvvmCross.Plugins.DateTimeConverter.svg)
[![CI](https://github.com/SByteDev/Net.MvvmCross.Plugins.DateTimeConverter/actions/workflows/ci.yml/badge.svg)](https://github.com/SByteDev/Net.MvvmCross.Plugins.DateTimeConverter/actions/workflows/ci.yml)
[![CD](https://github.com/SByteDev/Net.MvvmCross.Plugins.DateTimeConverter/actions/workflows/cd.yml/badge.svg)](https://github.com/SByteDev/Net.MvvmCross.Plugins.DateTimeConverter/actions/workflows/cd.yml)
[![CodeFactor](https://www.codefactor.io/repository/github/sbytedev/net.mvvmcross.plugins.datetimeconverter/badge)](https://www.codefactor.io/repository/github/sbytedev/net.mvvmcross.plugins.datetimeconverter)Provides a set of native converters to convert DateTime into the user-friendly string.
## Installation
Use [NuGet](https://www.nuget.org) package manager to install this library.
```bash
Install-Package SByteDev.MvvmCross.Plugins.DateTimeConverter
```## Usage
```cs
using SByteDev.MvvmCross.Plugins.DateTimeConverter;
```### iOS
|Converter|Output|
|---------|------|
|DateTimeToLongDateString|Feb 3, 2020|
|DateTimeToLongDateTimeString|Feb 3, 2020 at 6:30:10 PM GMT+3|
|DateTimeToLongTimeString|6:30:10 PM GMT+3|
|DateTimeToMediumDateString|Feb 3, 2020|
|DateTimeToMediumDateTimeString|Feb 3, 2020 at 6:30:10 PM|
|DateTimeToMediumTimeString|6:30:10 PM|
|DateTimeToShortDateString|2/3/20|
|DateTimeToShortDateTimeString|2/3/20, 6:30 PM|
|DateTimeToShortTimeString|6:30 PM|
|DateTimeToRelativeDateTimeString|now,last week, etc.|### Android
|Converter|Output|
|---------|------|
|DateTimeToDateString|February 3|
|DateTimeToDateTimeString|February 3, 6:30 PM|
|DateTimeToTimeString|6:30 PM|
|DateTimeToRelativeString|May 11, 2020|## Implementation
### iOS
Uses [NSDateFormatter](https://developer.apple.com/documentation/foundation/nsdateformatter) and [NSRelativeDateTimeFormatter](https://developer.apple.com/documentation/foundation/nsrelativedatetimeformatter).
### Android
Uses [DateUtils](https://developer.android.com/reference/android/text/format/DateUtils).
## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.Please make sure to update the tests as appropriate.
## License
[MIT](https://choosealicense.com/licenses/mit/)