Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Nov 2005
    Posts
    750
    Thanks
    138
    Thanked 1 Time in 1 Post

    Space in ordinal date

    Hello

    I use an ordinal date on a Web page, as in:
    Code:
    <%
    Dim suffix
    Select Case Day(Date())
        Case 1,21,31: suffix = "st"
        Case 2,22: suffix = "nd"
        Case 3,23: suffix = "rd"
        Case Else: suffix = "th"
    End Select
    
    
    Response.Write "<div class=""show_date"">" & WeekdayName(Weekday(Date())) _
                 & " " & Day(Date()) & "<sup>" & suffix & "</sup> " _
                 & MonthName(Month(Date())) & "</div>"
    
    %>
    The date works fine, but there is an unneccesary space between the 18th and the month (please see screenshot).

    I can't really see any mistakes to account for it.

    Thank you.
    Attached Thumbnails Attached Thumbnails Space in ordinal date-asp_forum.jpg  

  • #2
    Supreme Master coder! Old Pedant's Avatar
    Join Date
    Feb 2009
    Posts
    25,857
    Thanks
    78
    Thanked 4,417 Times in 4,382 Posts
    It is YOUR code doing that.

    Look:
    Code:
    Response.Write "<div class=""show_date"">" & WeekdayName(Weekday(Date())) _
                 & " " & Day(Date()) & "<sup>" & suffix & "</sup> " _
                 & MonthName(Month(Date())) & "</div>"
    See the space after the > in "</sup> "??? Remove it.
    An optimist sees the glass as half full.
    A pessimist sees the glass as half empty.
    A realist drinks it no matter how much there is.

  • Users who have thanked Old Pedant for this post:

    SteveH (07-18-2012)

  • #3
    Regular Coder
    Join Date
    Nov 2005
    Posts
    750
    Thanks
    138
    Thanked 1 Time in 1 Post
    Well pointed out, Old Pedant

    It'c corrected now.

    Thanks!

    Steve


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •