asp.netページでSimpleWeather jqueryプラグインを使用していますが、正常に動作しています。 https://github.com/monkeecreate/jquery.simpleWeather
2 つの質問があります。
AM と PM の時刻を取得します。24 時間に修正する方法を知っている人はいますか。
もし私がweather.code http://developer.yahoo.com/weather/#codesを知っていれば、どうにかして暑い、雹などの私自身の名前を使用できますか?
$.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) { 結果 = 結果[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'; }