// the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
// Boston, MA 02110-1301, USA.
+#nullable enable
+
using System;
using System.Collections.Generic;
using System.ComponentModel;
public partial class TweetPrvPanel : SettingPanelBase
{
public TweetPrvPanel()
- {
- InitializeComponent();
- }
+ => this.InitializeComponent();
public void LoadConfig(SettingCommon settingCommon)
{
var dateTimeFormat = settingCommon.DateTimeFormat;
try
{
- if (DateTime.Now.ToString(dateTimeFormat).Length == 0)
+ if (DateTimeUtc.Now.ToLocalTimeString(dateTimeFormat).Length == 0)
{
// このブロックは絶対に実行されないはず
// 変換が成功した場合にLengthが0にならない
{
try
{
- LabelDateTimeFormatApplied.Text = DateTime.Now.ToString(CmbDateTimeFormat.Text);
+ LabelDateTimeFormatApplied.Text = DateTimeUtc.Now.ToLocalTimeString(CmbDateTimeFormat.Text);
}
catch (FormatException)
{
}
private void CmbDateTimeFormat_TextUpdate(object sender, EventArgs e)
- {
- CreateDateTimeFormatSample();
- }
+ => this.CreateDateTimeFormatSample();
private void CmbDateTimeFormat_SelectedIndexChanged(object sender, EventArgs e)
- {
- CreateDateTimeFormatSample();
- }
+ => this.CreateDateTimeFormatSample();
private void CmbDateTimeFormat_Validating(object sender, CancelEventArgs e)
{
}
private void LabelDateTimeFormatApplied_VisibleChanged(object sender, EventArgs e)
- {
- CreateDateTimeFormatSample();
- }
+ => this.CreateDateTimeFormatSample();
}
}