mirror of
https://gitee.com/dotnetchina/MiniExcel.git
synced 2024-11-29 18:38:08 +08:00
Fix CI error CS0122: 'DateTimeHelper' is inaccessible due to its protection level
This commit is contained in:
parent
0904a80d10
commit
09efad8aa1
@ -1,7 +1,7 @@
|
||||
version: build-{build}
|
||||
skip_tags: true
|
||||
image: Visual Studio 2019
|
||||
configuration: Release
|
||||
configuration: Debug
|
||||
build_script:
|
||||
- ps: |-
|
||||
#cd src
|
||||
|
@ -6,8 +6,6 @@
|
||||
|
||||
internal static partial class DateTimeHelper
|
||||
{
|
||||
private static DateTime basicDate = new DateTime(2021, 01, 01);
|
||||
|
||||
/// <summary>
|
||||
/// NumberFormat from NuGet ExcelNumberFormat MIT@License
|
||||
/// </summary>
|
||||
@ -15,17 +13,6 @@
|
||||
{
|
||||
return new NumberFormat(formatCode).IsDateTimeFormat;
|
||||
}
|
||||
|
||||
public static bool IsSingleDatetimeFormat(string formatCode)
|
||||
{
|
||||
var isDatetimeFormat = DateTime.TryParseExact(basicDate.ToString(formatCode), formatCode, CultureInfo.InvariantCulture, DateTimeStyles.AllowLeadingWhite | DateTimeStyles.AllowTrailingWhite, out var date);
|
||||
if (basicDate != date)
|
||||
isDatetimeFormat = false;
|
||||
|
||||
// TODO: double check
|
||||
// TODO: datetime format like yyyy need to convert to string not datetime
|
||||
return isDatetimeFormat;
|
||||
}
|
||||
}
|
||||
|
||||
internal static partial class DateTimeHelper
|
||||
|
@ -15,7 +15,7 @@ namespace MiniExcelLibs.Tests
|
||||
public class MiniExcelCsvAsycTests
|
||||
{
|
||||
[Fact]
|
||||
public async Task gb2312_Encoding_Read_Test()
|
||||
public async Task Gb2312_Encoding_Read_Test()
|
||||
{
|
||||
System.Text.Encoding.RegisterProvider(System.Text.CodePagesEncodingProvider.Instance);
|
||||
var path = PathHelper.GetSamplePath("csv/gb2312_Encoding_Read_Test.csv");
|
||||
@ -183,7 +183,7 @@ namespace MiniExcelLibs.Tests
|
||||
public async Task CsvExcelTypeTest()
|
||||
{
|
||||
{
|
||||
var path = Path.Combine(Path.GetTempPath(), $"{Guid.NewGuid().ToString()}.csv");
|
||||
var path = Path.Combine(Path.GetTempPath(), $"{Guid.NewGuid()}.csv");
|
||||
var input = new[] { new { A = "Test1", B = "Test2" } };
|
||||
await MiniExcel.SaveAsAsync(path, input);
|
||||
|
||||
@ -215,7 +215,7 @@ namespace MiniExcelLibs.Tests
|
||||
[Fact()]
|
||||
public async Task Create2x2_Test()
|
||||
{
|
||||
var path = Path.Combine(Path.GetTempPath(), $"{Guid.NewGuid().ToString()}.csv");
|
||||
var path = Path.Combine(Path.GetTempPath(), $"{Guid.NewGuid()}.csv");
|
||||
await MiniExcel.SaveAsAsync(path, new[] {
|
||||
new { c1 = "A1" ,c2 = "B1"},
|
||||
new { c1 = "A2" ,c2 = "B2"},
|
||||
@ -244,7 +244,7 @@ namespace MiniExcelLibs.Tests
|
||||
[Fact()]
|
||||
public async Task CsvTypeMappingTest()
|
||||
{
|
||||
var path = Path.Combine(Path.GetTempPath(), $"{Guid.NewGuid().ToString()}.csv");
|
||||
var path = Path.Combine(Path.GetTempPath(), $"{Guid.NewGuid()}.csv");
|
||||
await MiniExcel.SaveAsAsync(path, new[] {
|
||||
new { c1 = "A1" ,c2 = "B1"},
|
||||
new { c1 = "A2" ,c2 = "B2"},
|
||||
|
Loading…
Reference in New Issue
Block a user