DayAsString() public method

public DayAsString ( ) : string
return string
Exemplo n.º 1
0
        private void ValidateFormat(
            string culture,
            string calendar,
            string clock,
            DateTimeOffset date,
            string yearAsPaddedString,
            string yearAsString,
            string monthAsPaddedNumericString,
            string monthAsSoloString,
            string monthAsString,
            string monthAsNumericString,
            string dayAsPaddedString,
            string dayAsString,
            string hourAsPaddedString,
            string hourAsString,
            string minuteAsPaddedString,
            string minuteAsString,
            string secondAsPaddedString,
            string secondAsString,
            string nanosecondAsPaddedString,
            string nanosecondAsString,
            string dayOfWeekAsSoloString,
            string dayOfWeekAsString
            )
        {
            var SUT = new WG.Calendar(new[] { culture }, calendar, clock);

            SUT.SetDateTime(date);

            using (new AssertionScope("Calendar Format"))
            {
                SUT.YearAsPaddedString(2).Should().Be(yearAsPaddedString, nameof(yearAsPaddedString));
                SUT.YearAsString().Should().Be(yearAsString, nameof(yearAsString));
                SUT.MonthAsPaddedNumericString(2).Should().Be(monthAsPaddedNumericString, nameof(monthAsPaddedNumericString));
                SUT.MonthAsSoloString().Should().Be(monthAsSoloString, nameof(monthAsSoloString));
                SUT.MonthAsString().Should().Be(monthAsString, nameof(monthAsString));
                SUT.MonthAsNumericString().Should().Be(monthAsNumericString, nameof(monthAsNumericString));
                SUT.DayAsPaddedString(2).Should().Be(dayAsPaddedString, nameof(dayAsPaddedString));
                SUT.DayAsString().Should().Be(dayAsString, nameof(dayAsString));
                SUT.HourAsPaddedString(2).Should().Be(hourAsPaddedString, nameof(hourAsPaddedString));
                SUT.HourAsString().Should().Be(hourAsString, nameof(hourAsString));
                SUT.MinuteAsPaddedString(2).Should().Be(minuteAsPaddedString, nameof(minuteAsPaddedString));
                SUT.MinuteAsString().Should().Be(minuteAsString, nameof(minuteAsString));
                SUT.SecondAsPaddedString(2).Should().Be(secondAsPaddedString, nameof(secondAsPaddedString));
                SUT.SecondAsString().Should().Be(secondAsString, nameof(secondAsString));
                SUT.NanosecondAsPaddedString(2).Should().Be(nanosecondAsPaddedString, nameof(nanosecondAsPaddedString));
                SUT.NanosecondAsString().Should().Be(nanosecondAsString, nameof(nanosecondAsString));
                SUT.DayOfWeekAsSoloString().Should().Be(dayOfWeekAsSoloString, nameof(dayOfWeekAsSoloString));
                SUT.DayOfWeekAsString().Should().Be(dayOfWeekAsString, nameof(dayOfWeekAsString));
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// Invoked when this page is about to be displayed in a Frame.
        /// </summary>
        /// <param name="e">Event data that describes how this page was reached.
        /// This parameter is typically used to configure the page.</param>
        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            // TODO: Prepare page for display here.

            // TODO: If your application contains multiple pages, ensure that 
            // you are handling the hardware Back button by registering for the
            // Windows.Phone.UI.Input.HardwareButtons.BackPressed event.
            // If you are using the NavigationHelper provided by some templates,
            // this event is handled for you.
            FBSession sess = FBSession.ActiveSession;

            if (sess.LoggedIn)
            {
                LoginButton.Content = "Logout";
                Calendar cal = new Calendar();
                cal.SetDateTime(sess.AccessTokenData.ExpirationDate);

                ResponseText.Text = sess.AccessTokenData.AccessToken;

                ExpirationDate.Text = cal.DayOfWeekAsString() + "," + 
                    cal.YearAsString() + "/" + cal.MonthAsNumericString() + 
                    "/" + cal.DayAsString() + ", " + cal.HourAsPaddedString(2) + 
                    ":" + cal.MinuteAsPaddedString(2) + ":" + 
                    cal.SecondAsPaddedString(2);
            }
        }
Exemplo n.º 3
0
 internal override string GetValueStringForNonGregorianCalendars(Windows.Globalization.Calendar calendar)
 {
     return(string.Format("{0}/{1}/{2}", calendar.MonthAsNumericString(), calendar.DayAsString(), calendar.YearAsString()));
 }