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 8499657
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T00:43:37+00:00 2026-06-11T00:43:37+00:00

I’m playing with the SimpleWeather jquery plugin, on an asp.net page and its working

  • 0

I’m playing with the SimpleWeather jquery plugin, on an asp.net page and its working fine.
https://github.com/monkeecreate/jquery.simpleWeather

I just have 2 questions:

  1. I get the times in AM and PM, is there someone thats know how to fix it to 24H.

  2. If i know the weather.code http://developer.yahoo.com/weather/#codes can I then somehow us my own names for hot, hail, and so on?

    $.getJSON(
    weatherUrl,
    function (data) {
    if (data !== null && data.query.results !== null) {
    $.each(data.query.results, function (i, result) {
    if (result.constructor.toString().indexOf(“Array”) !== -1) {
    result = result[0];
    }

        var currentDate = new Date();
        var sunRise = new Date(currentDate.toDateString() + ' ' + result.astronomy.sunrise);
        var sunSet = new Date(currentDate.toDateString() + ' ' + result.astronomy.sunset);
    
        if (currentDate > sunRise && currentDate < sunSet) {
            var timeOfDay = 'd';
        } else {
            var timeOfDay = 'n';
        }
    
  • 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-11T00:43:38+00:00Added an answer on June 11, 2026 at 12:43 am

    If u need to show 24H time with the SimpleWeather jQuery plugin, then the solution from Yuriy is not working…

    But here is a working solution.

    In the js script find this code.

    var currentDate = new Date();
    var sunRise = new Date(currentDate.toDateString() + ' ' + result.astronomy.sunrise);
    var sunSet = new Date(currentDate.toDateString() + ' ' + result.astronomy.sunset);
    
    if (currentDate > sunRise && currentDate < sunSet) {
        var timeOfDay = 'd';
    } else {
        var timeOfDay = 'n';
    }
    

    And then changes that code to this (there is some issue with the sunset in 24H if the sunset is 20:05 then it showed the time as 20:5 i dident show the xx:0x first 0 in the MM-time, this code is fixing that issue)

                            var currentDate = new Date();
                            var sunRise = new Date(currentDate.toDateString() + ' ' + result.astronomy.sunrise);
                            var sunSet = new Date(currentDate.toDateString() + ' ' + result.astronomy.sunset);
    
                            var sunRiseHour = "" + sunRise.getHours() + "";
                            var sunRiseMinute = "" + sunRise.getMinutes() + "";
                            var sunSetHour = "" + sunSet.getHours() + "";
                            var sunSetMinute = "" + sunSet.getMinutes() + "";
    
                            if (sunRiseHour.length == 1) {
                                sunRiseHour = "0" + sunRiseHour;
                            }
                            if (sunRiseMinute.length == 1) {
                                sunRiseMinute = "0" + sunRiseMinute;
                            }
                            if (sunSetHour.length == 1) {
                                sunSetHour = "0" + sunSetHour;
                            }
                            if (sunSetMinute.length == 1) {
                                sunSetMinute = "0" + sunSetMinute;
                            }
                            var sunRiseTime = sunRiseHour + ":" + sunRiseMinute;
                            var sunSetTime = sunSetHour + ":" + sunSetMinute;
    
    
                            if (currentDate > sunRise && currentDate < sunSet) {
                                var timeOfDay = 'd';
                            } else {
                                var timeOfDay = 'n';
                            }
    

    Remember to use SunSetTime and SunRiseTime if showing 24H and not the AM/PM ex. SunSet and SunRise.

    And it also fix the issue for the HH-time if there is an issue with the first 0 in hours also.
    Happy using…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a jquery bug and I've been looking for hours now, I can't
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I'm trying to select an H1 element which is the second-child in its group
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I would like my Web page http://www.gmarks.org/math_in_e-mail.txt on my Apache 2.2.14 server to display

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.