Exemple #1
0
        /// <summary>Create a new Git oriented date formatter</summary>
        /// <param name="format"></param>
        public GitDateFormatter(GitDateFormatter.Format format)
        {
            this.format = format;
            switch (format)
            {
                default:
                {
                    break;
                    break;
                }

                case GitDateFormatter.Format.DEFAULT:
                {
                    // Not default:
                    dateTimeInstance = new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy Z", CultureInfo
                        .InvariantCulture);
                    break;
                }

                case GitDateFormatter.Format.ISO:
                {
                    dateTimeInstance = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss Z", CultureInfo.InvariantCulture
                        );
                    break;
                }

                case GitDateFormatter.Format.LOCAL:
                {
                    dateTimeInstance = new SimpleDateFormat("EEE MMM dd HH:mm:ss yyyy", CultureInfo.InvariantCulture
                        );
                    break;
                }

                case GitDateFormatter.Format.RFC:
                {
                    dateTimeInstance = new SimpleDateFormat("EEE, dd MMM yyyy HH:mm:ss Z", CultureInfo
                        .InvariantCulture);
                    break;
                }

                case GitDateFormatter.Format.SHORT:
                {
                    dateTimeInstance = new SimpleDateFormat("yyyy-MM-dd", CultureInfo.InvariantCulture
                        );
                    break;
                }

                case GitDateFormatter.Format.LOCALE:
                case GitDateFormatter.Format.LOCALELOCAL:
                {
                    CultureInfo locale = SystemReader.GetInstance().GetLocale();
                    dateTimeInstance = DateFormat.GetDateTimeInstance(DateFormat.DEFAULT, DateFormat.
                        DEFAULT, locale);
                    dateTimeInstance2 = new SimpleDateFormat("Z", locale);
                    break;
                }
            }
        }
 public override void SetUp()
 {
     base.SetUp();
     dateFormatter = new GitDateFormatter(GitDateFormatter.Format.DEFAULT);
 }
		/// <summary>Create a new squash message formatter.</summary>
		/// <remarks>Create a new squash message formatter.</remarks>
		public SquashMessageFormatter()
		{
			dateFormatter = new GitDateFormatter(GitDateFormatter.Format.DEFAULT);
		}
		public override void SetUp()
		{
			base.SetUp();
			dateFormatter = new GitDateFormatter(GitDateFormatter.Format.DEFAULT);
			msgFormatter = new SquashMessageFormatter();
		}