Charts iOS I have used LineCharts in iOS but after upgrading to swift 4 Charts removed date from bottom - swift4

After swift 4 upgrade it is not showing dates here at bottom.
Before it was showing like below.
After converting my code to swift 4(Xcode 9.2) date just disappear from my data. I have passed my dates array here as:
// x-Axis Setup months
self.lineChart.xAxis.valueFormatter = IndexAxisValueFormatter(values: ["12 Jan", "14 Feb", "8 Mar", "23 Apr"])

Hey I found solution for this after a long days. To fix this, use this line in your Podfile.
pod 'Charts', '3.0.4'
It works by doing this.
Now 3.1.1 resolved this issue you can directly install latest one.

Related

How to Convert current date to hebrew date in Flutter or Dart?

I want to Convert Current Date to Hebrew Date but didn't find any solution for it.
Input
11 March 2021
Output
27 Adar 5781
I tried this package : https://pub.dev/packages/shamsi_date but didn't work for my solution.
You can try using 2 ways:
Using Flutter Package : https://pub.dev/packages/kosher_dart
Using API : https://www.hebcal.com/home/developer-apis
You can use this method GetHebrewCalendar(HebrewMonthNumbering) from this package: https://pub.dev/packages/time_machine

Display Today, yesterday, tommorrow instead of dates in ionic

i am making an ionic app v2 in which i have to show 'today' instead of current date and 'yesterday' and 'tomorrow' also for respective dates. i tried using moment but it gives days till last week like last monday and reference time issue is also there with moment. i need for only these 3 days without reference time . can you tell me how to customize moment in ionic framework ? if you have any other suggestions than using moment . please tell. thanks in advance.
P.S: i want to implement this only in html code of ionic not in typescript code.
Just like this: moment().add(-1, 'days'). It will give you the previous day with the same exact current time that is on your local pc.
Ref here
Agreed that this will be difficult without JS/TS. In your .ts file couldn't you have 3 date member variables:
//Set up 3 new dates, defaulting them to today
yesterday: Date = new Date();
today: Date = new Date();
tomorrow: Date = new Date();
And then in your ctor or init method, set them up properly (below is likely not the most valid/efficient way, but is an example).
//Today is already set up from instantiation, but re-set tomorrow and yesterday
this.tomorrow.setDate(this.tomorrow.getDate() + 1);
this.yesterday.setDate(this.yesterday.getDate() - 1);
And then in your HTML, bind to them:
Yesterday was: {{yesterday?.toDateString()?.slice(0,10)}}
<br> Today is: {{today?.toDateString()?.slice(0,10)}}
<br> Tomorrow will be: {{tomorrow?.toDateString()?.slice(0,10)}}

How do I search GitHub issues "created in the last seven days"?

We'd like to list all GitHub issues created in the last seven (or, n) days. This is a relative time window.
We don't want to use a specific date, because we'd like to create a link that is always correct (so we can link to the report of recent issues).
Thanks!
According to https://help.github.com/articles/searching-issues/#search-based-on-when-an-issue-or-pull-request-was-created-or-last-updated
created:2016-12-01..2016-12-08
Will output issue created during these 7 days.
You could create a bookmarklet, like I have, to for example, show your merged PRs last 7 days within a repo. Here's my bookmarklet:
javascript:document.location.href%3D%60https://github.com/calcom/cal.com/pulls%3Fq%3Dis%253Apr%2Bauthor%253Aleog%2Bis%253Aclosed%2Bmerged%253A%253E%24%7Bnew Date((new Date).setDate((new Date).getDate()-7)).toISOString().split("T")%5B0%5D%7D%60%3B

SMF.UI.showDatePicker Showing Wrong Date

I'm not getting the selected date, but the emulator's system date. Tried publishing and installing on actual Samsung S6, same it's showing system date not selected date. Is there something wrong with my code below?
function Page1_TextButton1_OnPressed(e)
{
SMF.UI.showDatePicker({onSelect:DoSomething});
}
function DoSomething(e)
{
alert(e.date);
}
Your code has some missing but that is not the actual problem. You are probably trying to select a date from past. There is a problem about that and will be fixed with the next release.
By the way I suggest you to use datePicker as in the documents (http://docs.smartface.io/html/M_SMF_UI_showDatePicker.htm).
You should add mask, minDate and maxDate values, etc.
But as I said, although you add these values to your project, it will not work now. The problem will be fixed with the next release.

How to make Jasper Reports programmatically determine the Name of Columns within the report it self?

I am generating a report with that will have a 7 columns where the last 6 should have the the last 6 months listed. So as of the time of this writing it should be:
NAME -> September -> August -> July -> June -> May -> April
ss the column headers. I am trying to avoid having to pass them in as parameters, and am trying to get Jasper Reports to figure it out at runtime. I can get the first month pretty easily using a Text Field Expression. It looks like:
new java.text.SimpleDateFormat("MMMMM").format(new Date())
The issue comes in with the other months. I initially tried
new java.text.SimpleDateFormat("MMMMM").format(java.util.Calendar.getInstance().add(Calendar.MONTH, new Integer("-1)).getTime())
This does not work since Calendar.add does not return a Calendar instance. I then tried using a variable and then a combination of variables which also did not work.
How to make Jasper Reports programmatically determine the Name of Columns within the report it self?
I think the best approach to solving this problem is to use Commons Lang. That package provides utilities to make calculations like this very easy. By adding one extra jar you can then use expressions like this:
DateUtils.addMonths(new Date(),-1)
I find that easier to maintain than first creating a helper Calendar class and then using the ternary operator but ignoring its results.
$P{cal}.add(Calendar.MONTH, -1)
? null : $P{cal}.getTime()
If you ever need to generalize the solution then it's a lot easier to get a Date back from a SQL query than to get a Calendar. So you can quickly change to "DateUtils.addMonths($F{MyDate},-1)". Initializing a Calendar to match a date returned by a query isn't nearly as simple. But of course there's a certain benefit to not having to add one more .jar file. So sometimes that ternary operator technique is the quickest way to get things done.
I wrote about using the Commons Lang approach a couple of years ago here: http://mdahlman.wordpress.com/2009/09/09/jasperreports-first-dates/
I also needed a certain format for the previous month. I ended up combining the other two answers:
new java.text.SimpleDateFormat("yyyyMM").format(
org.apache.commons.lang3.time.DateUtils.addMonths(
new java.util.Date(),
-6
)
)
This way I don't need to add another parameter. Adding the Commons Lang jar is a non issue for me since JasperServer 5.5 comes with version 3.0 out of the box.
I hope this helps someone who stumples upon this page, just like I did.
I found a working solution that is pretty ingenious (no I did not come up with it). I found it here. The gist of it is create a parameter called call, with a default value of:
Calendar.getInstance()
and un-check the option 'Use as a prompt'. Then in your text field expression you would do:
new java.text.SimpleDateFormat("MMMMM").format(
(
$P{cal}.add(Calendar.MONTH, -1)
? null : $P{cal}.getTime()
)
)
What happens is it will set the default value for the calendar instance, then execute the add method, which will resolve to false, so then it will then return the result from getTime() method which gets formatted how I want.