Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
186 commits
Select commit Hold shift + click to select a range
6118589
initial commit
neuecc Feb 3, 2020
3c39ddb
Update README.md
neuecc Feb 3, 2020
9ad4bbe
neuecc Feb 3, 2020
d9d1f49
Update README.md
neuecc Feb 4, 2020
ec76c8f
add netstandard2.0 shims
neuecc Feb 4, 2020
f4a9467
fix Infinite Loop of AppendFormat #1
neuecc Feb 4, 2020
2413faf
netstandard2 and tests
neuecc Feb 4, 2020
53339b9
ci
neuecc Feb 4, 2020
40c961f
comment out 2.1 test
neuecc Feb 4, 2020
592181e
unittest ok
neuecc Feb 4, 2020
d548c6f
Unity
neuecc Feb 4, 2020
62a9b63
CI
neuecc Feb 4, 2020
e7d1d15
mroe ci
neuecc Feb 4, 2020
202661e
more unity ci
neuecc Feb 4, 2020
80fd77d
readme
neuecc Feb 4, 2020
28b0eb7
more readme
neuecc Feb 4, 2020
8f402ac
Update README.md
neuecc Feb 4, 2020
afbd44a
Update README.md
neuecc Feb 4, 2020
7e74226
fix build freeze in dotnet-sdk($ProjectDir is not defined)
itn3000 Feb 5, 2020
031b2b1
Merge pull request #3 from itn3000/fix-freeze-build
neuecc Feb 5, 2020
20abf9d
neuecc Feb 10, 2020
4224b30
neuecc Feb 12, 2020
bd3d3a0
neuecc Feb 13, 2020
7f43eba
almost complete
neuecc Feb 13, 2020
42f8e50
neuecc Feb 13, 2020
06597e3
Merge pull request #4 from Cysharp/improve-perf
neuecc Feb 13, 2020
f687b8b
Update README.md
neuecc Feb 13, 2020
13d6645
Update README.md
neuecc Feb 13, 2020
34259d8
Update ZString.csproj
neuecc Feb 13, 2020
1a4f144
Update README.md
neuecc Feb 15, 2020
49dc090
Update README.md
neuecc Feb 17, 2020
e245eb4
Update README.md
neuecc Feb 20, 2020
1d9de35
Update README.md
neuecc Feb 20, 2020
59573af
Update README.md
neuecc Feb 20, 2020
9556ad6
Update README.md
neuecc Feb 26, 2020
f1cde72
Bumped libs
lukasz-pyrzyk Feb 27, 2020
23fc3d9
Merge pull request #5 from lukasz-pyrzyk/bumpedLibs
neuecc Feb 28, 2020
a95e2dd
neuecc Mar 2, 2020
d0d2146
neuecc Mar 30, 2020
fda4928
neuecc Mar 30, 2020
8712368
Merge pull request #9 from Cysharp/prepared
neuecc Mar 30, 2020
f904ddd
neuecc Mar 30, 2020
83cd990
neuecc Mar 30, 2020
642182a
neuecc Mar 30, 2020
80bc1e9
YoshifumiKawai Apr 3, 2020
3504ad4
Add Join<T>(char, XxxCollection) overloads
xin9le Apr 5, 2020
0191cb5
Merge pull request #11 from xin9le/join-overloads
neuecc Apr 5, 2020
24978c3
Update README.md
neuecc May 8, 2020
06e03c3
neuecc May 11, 2020
990ca70
Merge remote-tracking branch 'origin/master'
neuecc May 11, 2020
1da66d1
Update README.md
neuecc May 13, 2020
49a9e37
Improved the performance of ZString.Join when the type parameter is o…
udaken Jun 20, 2020
b31b7ee
Add Utf16ValueStringBuilder.Append(ReadOnlySpan<char> value)
udaken Jun 20, 2020
6b92716
Cleaned up ZString.Join
udaken Jun 20, 2020
6b94c72
Optimized for small list.
udaken Jun 21, 2020
77e26d0
Merge pull request #18 from udaken/improve-performance-of-Join
neuecc Jun 29, 2020
99ba117
unity
neuecc Jun 29, 2020
398af30
Implement Concat methods from collections
piti6 Jun 29, 2020
1fd77f2
Implement Test
piti6 Jun 29, 2020
e2c431f
Remove duplicated codes
piti6 Jul 2, 2020
58d200d
Add some manipulation methods to StringBuilder
udaken Jul 3, 2020
b735e58
Add Utf16ValueStringBuilder.Replace()
udaken Jul 3, 2020
c5fc107
Add Utf16ValueStringBuilder.Remove(int startIndex, int length)
udaken Jul 3, 2020
6b15314
Fix NetCore2Tests
udaken Jul 4, 2020
a9b279b
Remove duplicated codes in t4 file
udaken Jul 4, 2020
7a7c2f4
Make throw NestedStringBuilderCreationException on nested StringBuild…
udaken Jul 5, 2020
94f69db
Update Documentation comments
udaken Jul 5, 2020
4f9634d
some changes
udaken Jul 5, 2020
9d586e0
Add Utf16ValueStringBuilder.Insert
udaken Jul 6, 2020
8cfd48b
Built-in support for IntPtr/UIntPtr
udaken Jul 8, 2020
369667c
Built-in support for Nullable<T>
udaken Jul 11, 2020
4d8a383
update Utf8ValueStringBuilder.Append(char value, int repeatCount)
udaken Jul 15, 2020
f14f536
Fallback if IFormattable is supported
udaken Jul 14, 2020
095c6d7
Merge pull request #19 from piti6/implement-Concat-from-collections
neuecc Jul 30, 2020
6a39564
Merge pull request #20 from udaken/add-some-methods-to-StringBuilder
neuecc Jul 30, 2020
2c05982
Optimize ZString.Join(IReadOnlyList<T>)
udaken Jul 4, 2020
351d4a7
Add StringBuilder.AppendJoin
udaken Jul 4, 2020
6a301ba
update README.md
udaken Jul 30, 2020
a77acf1
Merge pull request #22 from udaken/Remove-duplicated-codes-in-t4-file
neuecc Jul 31, 2020
323246e
Merge pull request #23 from udaken/throw-NestedStringBuilderCreationE…
neuecc Jul 31, 2020
e94d2ab
Merge remote-tracking branch 'remotes/origin/master' into add-StringB…
udaken Jul 31, 2020
f546e27
Merge remote-tracking branch 'remotes/origin/master' into Built-in-su…
udaken Jul 31, 2020
8fb8adb
Add Test with Unicode Text
udaken Jul 19, 2020
487deb3
fix Utf8PreparedFormat
udaken Jul 19, 2020
38ee841
Merge branch 'add-StringBuilder-AppendJoin'
udaken Aug 1, 2020
655c360
ReRun T4 Text Templates Tool on VS2019(16.6.5)
udaken Aug 1, 2020
1ff7e56
Code cleanup
udaken Aug 1, 2020
ae8b646
Make ignored BenchmarkDotNet Results
udaken Aug 1, 2020
e1780cc
Bump up BenchmarkDotNet to v0.12.1
udaken Aug 1, 2020
03e0f4a
Add BenchmarkVsReleasedVersion project
udaken Jul 19, 2020
6919046
Improved performance of StringBuilder.AppendFormat
udaken Aug 1, 2020
ea6879d
Merge pull request #24 from udaken/Built-in-support-for-IntPtr-UIntPtr
neuecc Aug 3, 2020
01ff05c
Merge pull request #21 from udaken/add-StringBuilder-AppendJoin
neuecc Aug 3, 2020
98af493
Merge pull request #26 from udaken/fix-Utf8PreparedFormat
neuecc Aug 3, 2020
ed2a994
Merge pull request #27 from udaken/Improved-performance-of-StringBuil…
neuecc Aug 3, 2020
111a5d5
add unity meta
neuecc Aug 3, 2020
80f2211
update license readme
neuecc Aug 3, 2020
1691c24
ignore
neuecc Aug 3, 2020
8255f03
Merge remote-tracking branch 'origin/master'
neuecc Aug 3, 2020
450d01f
more unity meta
neuecc Aug 3, 2020
8083727
GitHub Actions
neuecc Aug 3, 2020
17e8ddc
docs: update TOC
neuecc Aug 3, 2020
7890fa1
Add package.json
neuecc Aug 3, 2020
14c36f5
meta
neuecc Aug 3, 2020
13c0b18
chore: remove generate unity alf (activation license file)
guitarrapc Aug 4, 2020
22dd038
chore: Unity Package version on debug build
guitarrapc Aug 4, 2020
6d48b72
Merge pull request #29 from Cysharp/chore/unity_activation
neuecc Aug 4, 2020
8570310
add BCL-Compatibility tests
udaken Jul 19, 2020
2d0f9cf
Update Benchmark code
udaken Aug 6, 2020
12f3e69
update BenchmarkVsReleasedVersion
udaken Aug 6, 2020
b2975a8
Improved compatibility of AppendFormat formatting string
udaken Jul 19, 2020
353fd61
Improved compatibility of PreparedFormat formatting string
udaken Jul 29, 2020
f790e99
Optimize PreparedFormat
udaken Aug 6, 2020
1f794e4
minor optimize
udaken Aug 7, 2020
c250bb6
optimize for bool type
udaken Aug 7, 2020
e08b539
Update README.md
neuecc Aug 11, 2020
d33379b
TMP extension for single file
kamyker Oct 9, 2020
6a40821
chore: replace set-env to ENV FILE $GITHUB_ENV
guitarrapc Oct 14, 2020
9837975
Merge pull request #34 from Cysharp/chore/github_Actions_security_fix
neuecc Oct 14, 2020
95d7c0e
Merge pull request #33 from kamyker/patch-2
neuecc Jan 8, 2021
ae478c5
Merge pull request #30 from udaken/rewrite-format-parser
neuecc Jan 8, 2021
1c80aa4
Merge pull request #31 from udaken/Optimize-for-bool-type
neuecc Jan 8, 2021
f618dee
Fix throws exception when enum has same value #32
neuecc Jan 14, 2021
7e2fefa
fix memory leak in Utf16ValueStringBuilder.Insert #36
neuecc Jan 14, 2021
31f8f14
ready for 2.3.0
neuecc Jan 14, 2021
e979a7e
add .meta
neuecc Jan 20, 2021
a56ac54
package.json for 2.3.1
neuecc Jan 20, 2021
434193d
added managed dlls as samples
Jan 24, 2021
e934499
fix package json format
Jan 24, 2021
b210471
chore: pr branch is master
guitarrapc Feb 3, 2021
d28c32c
chore: detect forgotten .meta file commit
guitarrapc Feb 3, 2021
4e885de
chore: chore: release on workflow_dispatch
guitarrapc Feb 3, 2021
c55f4c8
chore: new unity build with unityci/editor
guitarrapc Feb 8, 2021
8065bf8
Mantained TextMeshProExtensions.cs
udaken Feb 26, 2021
926eba9
Make StringBuilder follow the protocol of IDisposable.
udaken Feb 28, 2021
56b7a7b
fix: release tag update when package.json has change
guitarrapc Apr 5, 2021
8936d45
Merge pull request #41 from Cysharp/chore/release
neuecc Apr 6, 2021
c460fb7
Merge pull request #39 from GilbertoBitt/master
neuecc Apr 6, 2021
12c0c1d
Merge pull request #43 from udaken/make-StringBuilder-follow-the-prot…
neuecc Apr 6, 2021
e41ae07
Merge pull request #44 from udaken/mantained-TextMeshProExtensions
neuecc Apr 6, 2021
917a6f9
strong named
neuecc Apr 6, 2021
fe7f35e
import
neuecc Apr 6, 2021
fb22191
docs: update TOC
neuecc Apr 6, 2021
0be4d40
feat: Update package.json to 2.4.0
github-actions[bot] Apr 6, 2021
446c14d
Merge pull request #42 from Cysharp/chore/image
neuecc Apr 6, 2021
1f7fdcf
fix: remove non use GIT_TAG
guitarrapc Apr 6, 2021
8ac59c0
Update README.md
neuecc Apr 6, 2021
2aec847
improve Utf16StringBuilder.Append performance
neuecc Apr 13, 2021
2b477cb
improve Utf8ValueStringBuilder.Append performance
neuecc Apr 13, 2021
0d873cd
Merge remote-tracking branch 'origin/master'
neuecc Apr 13, 2021
48a6d75
feat: Update package.json to 2.4.1
github-actions[bot] Apr 13, 2021
55dd1e3
shore: skip ci supported by default
guitarrapc Apr 19, 2021
11760ec
Merge remote-tracking branch 'origin/master'
guitarrapc Apr 19, 2021
ed9afed
Add ZStringWriter
lahma Apr 23, 2021
7bf1a46
Merge pull request #50 from lahma/ZStringWriter
neuecc Apr 29, 2021
6780644
ZStringWriter for Unity
neuecc Apr 30, 2021
044a79a
feat: Update package.json to 2.4.2
github-actions[bot] Apr 30, 2021
de77404
Update README.md
neuecc Apr 30, 2021
335d4a3
add ReplaceAt method to Utf16ValueStringBuilder
to11mtm May 7, 2021
bb447bc
chore: remove setup-dotnet
guitarrapc May 24, 2021
9a6fed5
remove some redundant methods
SimonCropp Jun 9, 2021
6f32760
Improved performance of Utf16ValueStringBuilder.AppendFormat on Slow …
udaken May 29, 2021
07c4342
Improved performance of Utf16ValueStringBuilder.Append/Utf8ValueStrin…
udaken Jun 13, 2021
eecc20f
Merge pull request #52 from Cysharp/chore/setup_dotnet
neuecc Jul 26, 2021
462d35e
Merge pull request #51 from to11mtm/add-utf16valuestringbuilder-repla…
neuecc Nov 2, 2021
c10c56c
Merge pull request #60 from udaken/Improved-performance-of-AppendFormat
neuecc Nov 2, 2021
a3e699c
Merge pull request #59 from SimonCropp/redundantMethods
neuecc Nov 2, 2021
b6a45c9
feat: Update package.json to 2.4.3
github-actions[bot] Nov 2, 2021
3c25e7a
Squashed commit of the following:
axunonb Nov 2, 2021
796b0db
Merge branch 'axuno:version/v3.0' into version/v3.0
axunonb Nov 3, 2021
e46513c
Merge branch 'axuno:version/v3.0' into version/v3.0
axunonb Nov 3, 2021
450dbd1
Merge branch 'axuno:version/v3.0' into version/v3.0
axunonb Nov 5, 2021
fae8aab
Merge branch 'axuno:version/v3.0' into version/v3.0
axunonb Nov 7, 2021
8e932e9
Merge branch 'axuno:version/v3.0' into version/v3.0
axunonb Nov 17, 2021
9f7e15a
Merge branch 'axuno:version/v3.0' into version/v3.0
axunonb Dec 3, 2021
caa3273
Merge remote-tracking branch 'SmartFormat.ZString/master' into versio…
axunonb Dec 5, 2021
b327ef1
Merge branch 'axuno:version/v3.0' into version/v3.0
axunonb Dec 5, 2021
0f1c080
Merge branch 'axuno:version/v3.0' into version/v3.0
axunonb Dec 7, 2021
02d73c9
Merge branch 'axuno:version/v3.0' into version/v3.0
axunonb Dec 19, 2021
82c045f
Reduced complexity of constructor
axunonb Dec 23, 2021
247fafe
Undo changes in Format.SubString(int, int)
axunonb Dec 23, 2021
96bc5eb
Correct typo in variable name
axunonb Dec 23, 2021
357f843
Cyclomatic complexity in PluralRules.DualFromZeroToTwo
axunonb Dec 23, 2021
1e0bb22
Add pr #234 to CHANGES.md
axunonb Dec 23, 2021
82b8c76
Cyclomatic complexity in TimeFormatter.TryEvaluateFormat and TimeSpan…
axunonb Dec 23, 2021
b55712a
Remove unnecessary class variables
axunonb Dec 23, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 18 additions & 16 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ SmartFormat is not a fully-fledged HTML parser. If this is required, use [AngleS
b) Get the culture from the `IFormatProvider` argument (which may be a `CultureInfo`) to `SmartFormatter.Format(IFormatProvider, string, object?[])`<br/>
c) The `CultureInfo.CurrentUICulture`<br/>

### 20. Refactored `TimeFormatter` ([#220](https://github.com/axuno/SmartFormat/pull/220), [#221](https://github.com/axuno/SmartFormat/pull/221))
### 20. Refactored `TimeFormatter` ([#220](https://github.com/axuno/SmartFormat/pull/220), [#221](https://github.com/axuno/SmartFormat/pull/221), [#234](https://github.com/axuno/SmartFormat/pull/234))

* Constructor with string argument for default language is obsolete.
* Property `DefaultTwoLetterISOLanguageName` is obsolete.
Expand All @@ -323,21 +323,23 @@ SmartFormat is not a fully-fledged HTML parser. If this is required, use [AngleS
* **New:** Custom languages can now easily be added to `CommonLanguagesTimeTextInfo`. Custom languages override built-in definitions.
```CSharp
var language = "nl"; // dummy - it's English, not Dutch ;-)
TimeTextInfo custom = new(
pluralRule: PluralRules.GetPluralRule(language),
week: new[] { "{0} week", "{0} weeks" },
day: new[] { "{0} day", "{0} days" },
hour: new[] { "{0} hour", "{0} hours" },
minute: new[] { "{0} minute", "{0} minutes" },
second: new[] { "{0} second", "{0} seconds" },
millisecond: new[] { "{0} millisecond", "{0} milliseconds" },
w: new[] { "{0}w" },
d: new[] { "{0}d" },
h: new[] { "{0}h" },
m: new[] { "{0}m" },
s: new[] { "{0}s" },
ms: new[] { "{0}ms" },
lessThan: "less than {0}");
TimeTextInfo custom = new()
{
PluralRule = PluralRules.GetPluralRule(language),
Ptxt_week = new[] { "{0} week", "{0} weeks" },
Ptxt_day = new[] { "{0} day", "{0} days" },
Ptxt_hour = new[] { "{0} hour", "{0} hours" },
Ptxt_minute = new[] { "{0} minute", "{0} minutes" },
Ptxt_second = new[] { "{0} second", "{0} seconds" },
Ptxt_millisecond = new[] { "{0} millisecond", "{0} milliseconds" },
Ptxt_w = new[] { "{0}w" },
Ptxt_d = new[] { "{0}d" },
Ptxt_h = new[] { "{0}h" },
Ptxt_m = new[] { "{0}m" },
Ptxt_s = new[] { "{0}s" },
Ptxt_ms = new[] { "{0}ms" },
Ptxt_lessThan = "less than {0}"
};
CommonLanguagesTimeTextInfo.AddLanguage(language, custom)
```
* **Changed:**
Expand Down
64 changes: 34 additions & 30 deletions src/SmartFormat.Tests/Utilities/CommonLanguagesTimeTextInfoTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,21 +28,23 @@ public void Get_TimeTextInfo_For_BuiltIn_Languages(string language, string prope
public void Add_Valid_Custom_Language_TimeTextInfo()
{
var language = "nl"; // dummy - it's English, not Dutch ;-)
TimeTextInfo custom = new(
pluralRule: PluralRules.GetPluralRule(language),
week: new[] { "{0} week", "{0} weeks" },
day: new[] { "{0} day", "{0} days" },
hour: new[] { "{0} hour", "{0} hours" },
minute: new[] { "{0} minute", "{0} minutes" },
second: new[] { "{0} second", "{0} seconds" },
millisecond: new[] { "{0} millisecond", "{0} milliseconds" },
w: new[] { "{0}w" },
d: new[] { "{0}d" },
h: new[] { "{0}h" },
m: new[] { "{0}m" },
s: new[] { "{0}s" },
ms: new[] { "{0}ms" },
lessThan: "less than {0}");
TimeTextInfo custom = new()
{
PluralRule = PluralRules.GetPluralRule(language),
Ptxt_week = new[] { "{0} week", "{0} weeks" },
Ptxt_day = new[] { "{0} day", "{0} days" },
Ptxt_hour = new[] { "{0} hour", "{0} hours" },
Ptxt_minute = new[] { "{0} minute", "{0} minutes" },
Ptxt_second = new[] { "{0} second", "{0} seconds" },
Ptxt_millisecond = new[] { "{0} millisecond", "{0} milliseconds" },
Ptxt_w = new[] { "{0}w" },
Ptxt_d = new[] { "{0}d" },
Ptxt_h = new[] { "{0}h" },
Ptxt_m = new[] { "{0}m" },
Ptxt_s = new[] { "{0}s" },
Ptxt_ms = new[] { "{0}ms" },
Ptxt_lessThan = "less than {0}"
};

Assert.That(() => CommonLanguagesTimeTextInfo.AddLanguage(language, custom), Throws.Nothing);
Assert.That(() => CommonLanguagesTimeTextInfo.GetTimeTextInfo(language), Is.EqualTo(custom));
Expand All @@ -54,21 +56,23 @@ public void Add_Invalid_Custom_Language_TimeTextInfo_Should_Throw()
var language = "123xyz";
Assert.That(() =>
{
TimeTextInfo custom = new(
pluralRule: PluralRules.GetPluralRule(language),
week: new[] { "{0} week", "{0} weeks" },
day: new[] { "{0} day", "{0} days" },
hour: new[] { "{0} hour", "{0} hours" },
minute: new[] { "{0} minute", "{0} minutes" },
second: new[] { "{0} second", "{0} seconds" },
millisecond: new[] { "{0} millisecond", "{0} milliseconds" },
w: new[] { "{0}w" },
d: new[] { "{0}d" },
h: new[] { "{0}h" },
m: new[] { "{0}m" },
s: new[] { "{0}s" },
ms: new[] { "{0}ms" },
lessThan: "less than {0}");
TimeTextInfo custom = new()
{
PluralRule = PluralRules.GetPluralRule(language),
Ptxt_week = new[] { "{0} week", "{0} weeks" },
Ptxt_day = new[] { "{0} day", "{0} days" },
Ptxt_hour = new[] { "{0} hour", "{0} hours" },
Ptxt_minute = new[] { "{0} minute", "{0} minutes" },
Ptxt_second = new[] { "{0} second", "{0} seconds" },
Ptxt_millisecond = new[] { "{0} millisecond", "{0} milliseconds" },
Ptxt_w = new[] { "{0}w" },
Ptxt_d = new[] { "{0}d" },
Ptxt_h = new[] { "{0}h" },
Ptxt_m = new[] { "{0}m" },
Ptxt_s = new[] { "{0}s" },
Ptxt_ms = new[] { "{0}ms" },
Ptxt_lessThan = "less than {0}"
};

CommonLanguagesTimeTextInfo.AddLanguage(language, custom);
},
Expand Down
43 changes: 25 additions & 18 deletions src/SmartFormat/Extensions/TimeFormatter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,31 @@ public bool TryEvaluateFormat(IFormattingInfo formattingInfo)
var v2Compatibility = options != string.Empty && formatText == string.Empty;
var formattingOptions = v2Compatibility ? options : formatText;

TimeSpan? fromTime = null;
var fromTime = GetFromTime(current, formattingOptions);

if (fromTime is null)
{
// Auto detection calls just return a failure to evaluate
if (formatterName == string.Empty)
return false;

// throw, if the formatter has been called explicitly
throw new FormatException(
$"Formatter named '{formatterName}' can only process types of {nameof(TimeSpan)}, {nameof(DateTime)}, {nameof(DateTimeOffset)}");
}

var timeTextInfo = GetTimeTextInfo(formattingInfo, v2Compatibility);

var timeSpanFormatOptions = TimeSpanFormatOptionsConverter.Parse(v2Compatibility ? options : formatText);
var timeString = fromTime.Value.ToTimeString(timeSpanFormatOptions, timeTextInfo);
formattingInfo.Write(timeString);
return true;
}

private static TimeSpan? GetFromTime(object? current, string? formattingOptions)
{
TimeSpan? fromTime = null;

switch (current)
{
case TimeSpan timeSpan:
Expand All @@ -165,23 +188,7 @@ public bool TryEvaluateFormat(IFormattingInfo formattingInfo)
break;
}

if (fromTime is null)
{
// Auto detection calls just return a failure to evaluate
if (formatterName == string.Empty)
return false;

// throw, if the formatter has been called explicitly
throw new FormatException(
$"Formatter named '{formatterName}' can only process types of {nameof(TimeSpan)}, {nameof(DateTime)}, {nameof(DateTimeOffset)}");
}

var timeTextInfo = GetTimeTextInfo(formattingInfo, v2Compatibility);

var timeSpanFormatOptions = TimeSpanFormatOptionsConverter.Parse(v2Compatibility ? options : formatText);
var timeString = fromTime.Value.ToTimeString(timeSpanFormatOptions, timeTextInfo);
formattingInfo.Write(timeString);
return true;
return fromTime;
}

private TimeTextInfo GetTimeTextInfo(IFormattingInfo formattingInfo, bool v2Compatibility)
Expand Down
Loading