Smart Watch One
1.0.0
03-06-2022
Watch Design for fetching Date & Weather
Fetching Date
It is an API key which fetchs real-time Date, Day.
fetchDate: function () {
const date = new Date();
this.date_d = (String(date.getDate()))
this.date_m = (String(date.getMonth() + 1))
const dayOfWeek = (date.getDay())
const month = (date.getMonth())
var days = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];
this.date_w = days[dayOfWeek];
var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];
this.date_m = months[month];
}
Weather API
API Key which gives the user real-time weather for a particular location.
fetchWeather: function () {
var dataw = JSON.stringify(item);
let weather_api_input = JSON.parse(dataw);
let data;
fetch.fetch({
url: "https://api.openweathermap.org/data/2.5/weather?lat=" + weather_api_input[0].latitude + "&lon=" + weather_api_input[0].longitude + "&appid=" + weather_api_input[0].api_key,
responseType: "json",
method: 'GET',
success: function (resp) {
data = JSON.stringify(resp);
console.info('Weather data fetch success. Resp: ' + data);
},
fail: function (data, code) {
console.log("fail data: " + JSON.stringify(data) + " fail code: " + code);
},
complete: () => {
const { main } = data.weather[0];
this.weather = main;
this.weather_description = main;
}
})
}
Features like Sliding bar which can calculate Calories-Burned, Heart Rate, Blood Oxygen Levels, Amount of Food Intake.
Smart Watch One can be used to get real-time weather, date and day.
If you find any problems during usage, you can submit an Issue to us. Of course, we also welcome you to send us PR.
This project is based on Apache License 2.0 ,please enjoy and participate in open source freely