Skip to content

Commit

Permalink
Doc updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
bsiever committed Jun 19, 2020
1 parent a8d066f commit a40ca2d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 17 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,13 @@ Here's an example that focuses on just the minutes (additional code is needed fo

```blocks
input.onButtonPressed(Button.B, function () {
timeanddate.numericTime(function (hour, minute, second, weekday, day, month, year, dayOfYear) {
timeanddate.numericTime(function (hour, minute, second, month, day, year) {
timeanddate.set24HourTime(hour, minute + -1, second)
})
})
input.onButtonPressed(Button.A, function () {
timeanddate.numericTime(function (hour, minute, second, weekday, day, month, year, dayOfYear) {
timeanddate.numericTime(function (hour, minute, second, month, day, year) {
timeanddate.set24HourTime(hour, minute + 1, second)
})
})
Expand All @@ -146,7 +146,7 @@ input.onButtonPressed(Button.A, function () {
timeanddate.setTime(11, 30, 0, timeanddate.MornNight.AM)
basic.showString("Set Hour")
while (!(input.buttonIsPressed(Button.AB))) {
timeanddate.numericTime(function (hour, minute, second, weekday, day, month, year, dayOfYear) {
timeanddate.numericTime(function (hour, minute, second, month, day, year) {
if (input.buttonIsPressed(Button.A)) {
timeanddate.set24HourTime(hour + 1, minute, 0)
} else if (input.buttonIsPressed(Button.B)) {
Expand All @@ -157,7 +157,7 @@ while (!(input.buttonIsPressed(Button.AB))) {
}
basic.showString("Set Min")
while (!(input.buttonIsPressed(Button.AB))) {
timeanddate.numericTime(function (hour, minute, second, weekday, day, month, year, dayOfYear) {
timeanddate.numericTime(function (hour, minute, second, month, day, year) {
if (input.buttonIsPressed(Button.A)) {
timeanddate.set24HourTime(hour, minute + 1, 0)
} else if (input.buttonIsPressed(Button.B)) {
Expand Down Expand Up @@ -227,7 +227,7 @@ Use the timestamp or the ``[timeanddate.numericTime()]`` block to get numeric v
Numeric values of time/date can be useful for things like alarm clocks. Use:

```sig
timeanddate.numericTime(function (hour, minute, second, weekday, day, month, year, dayOfYear) {
timeanddate.numericTime(function (hour, minute, second, month, day, year) {
})
```

Expand Down Expand Up @@ -374,7 +374,7 @@ while (!(input.buttonIsPressed(Button.B))) {
}
let blink = false
basic.forever(function () {
timeanddate.numericTime(function (hour, minute, second, weekday, day, month, year, dayOfYear) {
timeanddate.numericTime(function (hour, minute, second, month, day, year) {
hour = 0 % 12
if (hour == 0) {
hour = 12
Expand Down
11 changes: 0 additions & 11 deletions timeanddate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -330,17 +330,6 @@ namespace timeanddate {
timeToSetpoint += amount * units[unit]
}

// /**
// * Get all values of time as numbers.
// */
// //% block="current time as numbers $hour:$minute.$second on $weekday, $day/$month/$year, $dayOfYear" advanced=true
// //% draggableParameters=variable
// //% handlerStatement=1
// export function numericTime(handler: (hour: Hour, minute: Minute, second: Second, weekday: Weekday, day: Day, month: Month, year: Year, dayOfYear: DayOfYear) => void) {
// const cpuTime = cpuTimeInSeconds()
// const t = timeFor(cpuTime)
// handler(t.hour, t.minute, t.second, dayOfWeek(t.dayOfYear, t.year), t.day, t.month, t.year, t.dayOfYear)
// }

/**
* Get the Day of the week
Expand Down

0 comments on commit a40ca2d

Please sign in to comment.