Skip to content

Commit

Permalink
fix(calendar): formatting and delete redundancies
Browse files Browse the repository at this point in the history
  • Loading branch information
bkapustik committed Jul 4, 2024
1 parent 4919b79 commit 97123a8
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 37 deletions.
75 changes: 49 additions & 26 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Severity levels of analyzers https://docs.microsoft.com/en-us/visualstudio/code-quality/roslyn-analyzers-overview?view=vs-2019#severity-levels-of-analyzers
# Severity levels of analyzers https://docs.microsoft.com/en-us/visualstudio/code-quality/roslyn-analyzers-overview?view=vs-2019#severity-levels-of-analyzers

root = true

Expand Down Expand Up @@ -64,7 +64,7 @@ csharp_preserve_single_line_statements = fals
csharp_preserve_single_line_blocks = true

### Using directive options
csharp_using_directive_placement = outside_namespace : error
csharp_using_directive_placement = outside_namespace:error
dotnet_diagnostic.IDE0065.severity = error

# Code Style Rules
Expand Down Expand Up @@ -216,29 +216,29 @@ csharp_style_var_when_type_is_apparent = true
dotnet_diagnostic.IDE0007.severity = error
dotnet_diagnostic.IDE0008.severity = error

csharp_style_expression_bodied_constructors = true : error
csharp_style_expression_bodied_constructors = true:error
dotnet_diagnostic.IDE0021.severity = error

csharp_style_expression_bodied_methods = true : error
csharp_style_expression_bodied_methods = true:error
dotnet_diagnostic.IDE0022.severity = error

csharp_style_expression_bodied_operators = true : error
csharp_style_expression_bodied_operators = true:error
dotnet_diagnostic.IDE0023.severity = error
dotnet_diagnostic.IDE0024.severity = error

csharp_style_expression_bodied_properties = true : error
csharp_style_expression_bodied_properties = true:error
dotnet_diagnostic.IDE0025.severity = error

csharp_style_expression_bodied_indexers = true : error
csharp_style_expression_bodied_indexers = true:error
dotnet_diagnostic.IDE0026.severity = error

csharp_style_expression_bodied_accessors = true : error
csharp_style_expression_bodied_accessors = true:error
dotnet_diagnostic.IDE0027.severity = error

csharp_style_expression_bodied_lambdas = true : error
csharp_style_expression_bodied_lambdas = true:error
dotnet_diagnostic.IDE0053.severity = error

csharp_style_expression_bodied_local_functions = true : error
csharp_style_expression_bodied_local_functions = true:error
dotnet_diagnostic.IDE0061.severity = error

csharp_style_pattern_matching_over_as_with_null_check = true : error
Expand All @@ -256,10 +256,10 @@ dotnet_diagnostic.IDE0078.severity = erro
csharp_style_prefer_not_pattern = true : error
dotnet_diagnostic.IDE0083.severity = error

csharp_prefer_braces = true : error
csharp_prefer_braces = true:error
dotnet_diagnostic.IDE0011.severity = error

csharp_prefer_simple_using_statement = true : error
csharp_prefer_simple_using_statement = true:error
dotnet_diagnostic.IDE0063.severity = error

csharp_style_prefer_index_operator = true : warning
Expand Down Expand Up @@ -297,45 +297,68 @@ dotnet_naming_symbols.const_field_symbols.required_modifiers = cons
dotnet_naming_symbols.const_field_symbols.applicable_accessibilities = *
dotnet_naming_style.const_field_symbols.capitalization = pascal_case

dotnet_naming_rule.const_fields_must_be_pascal_case.severity = error
dotnet_naming_rule.const_fields_must_be_pascal_case.severity = error
dotnet_naming_rule.const_fields_must_be_pascal_case.symbols = const_field_symbols
dotnet_naming_rule.const_fields_must_be_pascal_case.style = const_field_symbols
dotnet_naming_rule.const_fields_must_be_pascal_case.style = const_field_symbols

dotnet_naming_symbols.private_field_symbol.applicable_kinds = field
dotnet_naming_symbols.private_field_symbol.applicable_accessibilities = private
dotnet_naming_style.private_field_style.capitalization = camel_case
dotnet_naming_rule.private_fields_are_camel_case.severity = warning
dotnet_naming_rule.private_fields_are_camel_case.severity = warning
dotnet_naming_rule.private_fields_are_camel_case.symbols = private_field_symbol
dotnet_naming_rule.private_fields_are_camel_case.style = private_field_style
dotnet_naming_rule.private_fields_are_camel_case.style = private_field_style

dotnet_naming_symbols.non_private_field_symbol.applicable_kinds = field
dotnet_naming_symbols.non_private_field_symbol.applicable_accessibilities = public,internal,friend,protected,protected_internal,protected_friend
dotnet_naming_style.non_private_field_style.capitalization = pascal_case
dotnet_naming_rule.non_private_fields_are_pascal_case.severity = warning
dotnet_naming_rule.non_private_fields_are_pascal_case.severity = warning
dotnet_naming_rule.non_private_fields_are_pascal_case.symbols = non_private_field_symbol
dotnet_naming_rule.non_private_fields_are_pascal_case.style = const_field_symbols
dotnet_naming_rule.non_private_fields_are_pascal_case.style = non_private_field_style

dotnet_naming_symbols.parameter_symbol.applicable_kinds = parameter
dotnet_naming_style.parameter_style.capitalization = camel_case
dotnet_naming_rule.parameters_are_camel_case.severity = warning
dotnet_naming_rule.parameters_are_camel_case.severity = warning
dotnet_naming_rule.parameters_are_camel_case.symbols = parameter_symbol
dotnet_naming_rule.parameters_are_camel_case.style = private_field_style
dotnet_naming_rule.parameters_are_camel_case.style = parameter_style

dotnet_naming_symbols.non_interface_type_symbol.applicable_kinds = class,struct,enum,delegate
dotnet_naming_style.non_interface_type_style.capitalization = pascal_case
dotnet_naming_rule.non_interface_types_are_pascal_case.severity = error
dotnet_naming_rule.non_interface_types_are_pascal_case.severity = error
dotnet_naming_rule.non_interface_types_are_pascal_case.symbols = non_interface_type_symbol
dotnet_naming_rule.non_interface_types_are_pascal_case.style = const_field_symbols
dotnet_naming_rule.non_interface_types_are_pascal_case.style = non_interface_type_style

dotnet_naming_symbols.interface_type_symbol.applicable_kinds = interface
dotnet_naming_style.interface_type_style.capitalization = pascal_case
dotnet_naming_style.interface_type_style.required_prefix = I
dotnet_naming_rule.interface_types_must_be_prefixed_with_i.severity = error
dotnet_naming_rule.interface_types_must_be_prefixed_with_I.severity = error
dotnet_naming_rule.interface_types_must_be_prefixed_with_I.symbols = interface_type_symbol
dotnet_naming_rule.interface_types_must_be_prefixed_with_i.style = interface_type_style
dotnet_naming_rule.interface_types_must_be_prefixed_with_I.style = interface_type_style

dotnet_naming_symbols.member_symbol.applicable_kinds = method,property,event
dotnet_naming_style.member_style.capitalization = pascal_case
dotnet_naming_rule.members_are_pascal_case.severity = error
dotnet_naming_rule.members_are_pascal_case.severity = error
dotnet_naming_rule.members_are_pascal_case.symbols = member_symbol
dotnet_naming_rule.members_are_pascal_case.style = const_field_symbols
dotnet_naming_rule.members_are_pascal_case.style = member_style
csharp_style_namespace_declarations = block_scoped:silent
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_top_level_statements = true:silent
csharp_style_prefer_primary_constructors = true:suggestion
[*.{cs,vb}]
dotnet_style_operator_placement_when_wrapping = beginning_of_line
tab_width = 4
indent_size = 4
end_of_line = crlf
dotnet_style_coalesce_expression = true:error
dotnet_style_null_propagation = true:error
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:error
dotnet_style_prefer_auto_properties = true:warning
dotnet_style_object_initializer = true:error
dotnet_style_collection_initializer = true:error
dotnet_style_prefer_simplified_boolean_expressions = true:warning
dotnet_style_prefer_conditional_expression_over_assignment = true:error
dotnet_style_prefer_conditional_expression_over_return = true:silent
dotnet_style_explicit_tuple_names = true:error
dotnet_style_prefer_inferred_tuple_names = true:error
dotnet_style_prefer_inferred_anonymous_type_member_names = true:error
dotnet_style_prefer_compound_assignment = true:error
dotnet_style_prefer_simplified_interpolation = true:error
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ public ViewViewComponentResult Invoke(ComponentViewModel<ArticlesWidgetPropertie
return View("~/Components/Widgets/Articles/_ArticlesWidget.cshtml", new ArticlesWidgetViewModel { Articles = articlesModel, Count = viewModel.Properties.Count });
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public class CalendarFormComponent : FormComponent<CalendarFormComponentProperti
public override bool CustomAutopostHandling => true;

/// <inheritdoc />
public override DateTime GetValue() => DateTime.Parse(SelectedDate);
public override DateTime GetValue() => DateTime.Parse(SelectedDate, default);

/// <inheritdoc />
public override void SetValue(DateTime value) => SelectedDate = value.ToString();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public override void SetValue(string value)
tokens = value.Split(separator, StringSplitOptions.TrimEntries);
}

if (DateOnly.TryParse(tokens[0], out var firstDate))
if (DateOnly.TryParse(tokens[0], default, System.Globalization.DateTimeStyles.None, out var firstDate))
{
stringBuilder.Append(firstDate);
}
Expand All @@ -74,7 +74,7 @@ public override void SetValue(string value)

for (int i = 1; i < tokens.Length; i++)
{
if (DateOnly.TryParse(tokens[i], out var dateOnly))
if (DateOnly.TryParse(tokens[i], default, System.Globalization.DateTimeStyles.None, out var dateOnly))
{
stringBuilder.Append(';');
stringBuilder.Append(dateOnly);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,6 @@
let minDate = new Date(excludedDateTimeData.minDate);
let maxDate = new Date(excludedDateTimeData.maxDate);
let datee = new Date("20/11/2024");
console.log(minDate);
console.log(maxDate);
console.log(datee);
console.log(datee < minDate);
console.log(datee > maxDate);
flatpickrOptions.disable = [
function (date) {
Expand Down

0 comments on commit 97123a8

Please sign in to comment.