Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8944405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T12:00:47+00:00 2026-06-15T12:00:47+00:00

I have the following Code: Public Shared Function DPLoadData() As String Dim s As

  • 0

I have the following Code:

Public Shared Function DPLoadData() As String
    Dim s As StringBuilder = New StringBuilder("<head><meta http-equiv=""content-type"" content=""text/html;charset=utf-8"" /><META HTTP-EQUIV=""REFRESH"" CONTENT=""900"">")
    s.Append("<style type=""text/css"" media=""all""> body{font-family: Arial;}h4{font-size: 10pt;font-weight: bold;white-space: nowrap;margin-top: 0; margin-bottom: 10px;}")
    s.Append("th{font-size: 9pt;font-weight: normal;text-align: center;white-space: nowrap;}td{font-size: 9pt;}.content td{border: solid 1px #dadada;}")
    s.Append(".content th {border: solid 1px #dadada;background-image: url(""tbl_header_row_bg.gif""); background-repeat: repeat-x; white-space: nowrap;}</style></head>")
    s.Append("<h3>" & "Daily Plan" & "</h3>")
    Dim strCurrDay As String = ""
    s.Append("<h5>" & strCurrDay & "</h5>")

    Dim CurrDateFirstDay As Date = DateAdd(DateInterval.Day, 1, Now)
    strCurrDay = FormatDateTime(CurrDateFirstDay, DateFormat.LongDate)

    s.Append("<h5>" & strCurrDay & "</h5>")
    s.Append(LoadDataGroupByDate(CurrDateFirstDay))
    Return s.ToString()
End Function

The function generates an HTML file with a table and fills it with bookings. Currently, the HTML file displays the bookings of tomorrow (e.g. if today is Monday, it displays the bookings for Tuesday). So far so good. What I want is that if today is Friday, the HTML File should display the bookings for Monday, not Saturday. Is that possible?

My Solution:

        If value.DayOfWeek = DayOfWeek.Friday Then

            Dim CurrDateFirstDay As Date = DateAdd(DateInterval.Day, 3, Now)

            strCurrDay = FormatDateTime(CurrDateFirstDay, DateFormat.LongDate)
            s.Append("<h5>" & strCurrDay & "</h5>")
            s.Append(LoadDataGroupByDate(CurrDateFirstDay))
        Else
            Dim CurrDateFirstDay As Date = DateAdd(DateInterval.Day, 1, Now)

            strCurrDay = FormatDateTime(CurrDateFirstDay, DateFormat.LongDate)
            s.Append("<h5>" & strCurrDay & "</h5>")
            s.Append(LoadDataGroupByDate(CurrDateFirstDay))

        End If
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T12:00:48+00:00Added an answer on June 15, 2026 at 12:00 pm

    If you create a method like this:

    Public Function GetNextWeekDay() As Date
        Dim value As Date = Date.Now
        Do
            value = value.AddDays(1)
        Loop While (value.DayOfWeek = DayOfWeek.Saturday) Or (value.DayOfWeek = DayOfWeek.Sunday)
        Return value
    End Function
    

    Then you can set your variable like this:

    Dim CurrDateFirstDay As Date = GetNextWeekDay()
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If have the following Code: Public Shared Function GetNextWeekDay() As Date Dim value As
I have the following code: Public Shared Function GetListAsString(ByVal data As List(Of String)) As
I have the following code: Public Shared Function GetAvailableManufacturers() As List(Of Manufacturer) 'first get
I have following code public class TEST { public static void main(String arg[]){ try
i have the following code: public static void Serialize() { List<string> dirs = FileHelper.GetFilesRecursive(fileDirectoryPath);
I have the following code: public class AppDomainArgs : MarshalByRefObject { public string myString;
I have code as following: Public Class xxxSvcHostFactory Inherits ServiceHostFactory Protected Overrides Function CreateServiceHost(ByVal
I have an ASP.NET PageMethod with the following signature: <WebMethod()> _ Public Shared Function
I have following code: public static void ProcessStep(Action action) { //do something here if
I have the following code: public void disconnect() { running = false; if(thread !=

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.