waterbearlang / waterbear

Visual block syntax for programming languages
http://waterbearlang.com/
358 stars 88 forks source link

issue #899 add date blocks #1208

Closed ghost closed 9 years ago

ghost commented 9 years ago

Addressing issue #899:

The icons on the blocks are being repeated and I cannot see why. Also still need to add credit for the calendar icon, "Calendar by Edward Boatman from the Noun Project"

dethe commented 9 years ago

Block icon is repeating because the width is set to 1em (16px) but the icon is only 12px wide and the default for backgrounds is to tile them with repetition.

If you change

wb-expression[type=date]:before {
    background-image: url("http://localhost/waterbear/css/../images/icon/calendar.svg");
}

to

wb-expression[type=date]:before {
    background-image: url("http://localhost/waterbear/css/../images/icon/calendar.svg");
    background-repeat: no-repeat;
}

That should fix it.

ghost commented 9 years ago

Thanks! Fixed that issue. PR is ready for review.

dethe commented 9 years ago

I created a date 'now' and a date in 1965. I was able to subtract a day, add 4 months and all was well. Then I tried adding 50 years and got a date 100 years later. Just investigating now how that could have happened.

dethe commented 9 years ago

Ah, not in your code, it is a bug with how we handle variables. One more clue in a long-standing issue I've been trying to track down. Your code is fine. :shipit:

dethe commented 9 years ago

Some additional blocks to consider: accessor blocks to get the day of month, day of week (as a string), month as a number or string, year, print as a localized string or ISO8601 string ('YYYY-MM-DDThh:mm:ss.xxxZ')

ghost commented 9 years ago

For sure, I can get working on that tomorrow!