Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
1 change: 1 addition & 0 deletions Sources/Internal/Helpers/MDateFormatter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ extension MDateFormatter {
static func getString(for weekday: MWeekday, format: WeekdaySymbolFormat) -> String {
switch format {
case .veryShort: return getFormatter().veryShortWeekdaySymbols[weekday.rawValue - 1].capitalized
case .abbreviated: return getFormatter().standaloneWeekdaySymbols[weekday.rawValue - 1].prefix(2).capitalized
Copy link

Copilot AI Sep 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The .capitalized method on String.SubSequence may not produce the expected result. Since prefix(2) returns a SubSequence, calling .capitalized might not properly capitalize only the first letter. Consider converting to String first: String(getFormatter().standaloneWeekdaySymbols[weekday.rawValue - 1].prefix(2)).capitalized

Suggested change
case .abbreviated: return getFormatter().standaloneWeekdaySymbols[weekday.rawValue - 1].prefix(2).capitalized
case .abbreviated: return String(getFormatter().standaloneWeekdaySymbols[weekday.rawValue - 1].prefix(2)).capitalized

Copilot uses AI. Check for mistakes.
case .short: return getFormatter().shortWeekdaySymbols[weekday.rawValue - 1].capitalized
case .full: return getFormatter().standaloneWeekdaySymbols[weekday.rawValue - 1].capitalized
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/Public/Enums/Public+WeekdaySymbolFormat.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@
// Copyright ©2023 Mijick. Licensed under MIT License.


public enum WeekdaySymbolFormat { case veryShort, short, full }
public enum WeekdaySymbolFormat { case veryShort, abbreviated, short, full }
2 changes: 1 addition & 1 deletion Sources/Public/Extensions/Public+View.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@
import SwiftUI

public extension View {
func erased() -> AnyView { .init(self) }
@MainActor func erased() -> AnyView { .init(self) }
}
2 changes: 1 addition & 1 deletion Sources/Public/View Protocols/Public+DayView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

import SwiftUI

public protocol DayView: View {
@MainActor public protocol DayView: View {
// MARK: Attributes
var date: Date { get }
var isCurrentMonth: Bool { get }
Expand Down
2 changes: 1 addition & 1 deletion Sources/Public/View Protocols/Public+MonthLabel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import SwiftUI

public protocol MonthLabel: View {
@MainActor public protocol MonthLabel: View {
// MARK: Required Attributes
var month: Date { get }

Expand Down
2 changes: 1 addition & 1 deletion Sources/Public/View Protocols/Public+WeekdayLabel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import SwiftUI

public protocol WeekdayLabel: View {
@MainActor public protocol WeekdayLabel: View {
// MARK: Required Attributes
var weekday: MWeekday { get }

Expand Down
2 changes: 1 addition & 1 deletion Sources/Public/View Protocols/Public+WeekdaysView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

import SwiftUI

public protocol WeekdaysView: View {
@MainActor public protocol WeekdaysView: View {
// MARK: View Customisation
func createContent() -> AnyView
func createWeekdayLabel(_ weekday: MWeekday) -> AnyWeekdayLabel
Expand Down
Loading