Is it possible to beautify this data table using advanced JSON or something?
Currently, I'm getting this back:
Ideally, I'd like to get rid of everything else, except date, which is yyyy-MM-dd.
I've added this JSON to Advanced JSON Input:
{
"format" : "yyyy-MM-dd"
}
It does work in backend side, results are brought back in this format. However - Kibana still displays them in its own manner.
Elasticsearch version - 2.0
Kibana version - 4.2
you can change the data format with kibana in the menu of the index. You go to the camp and select type date and the format. They allow multiple diferents format. As yyyy-mmmm that even display the name of the month.
EDIT:
The best option to dont change all the date is perhaps duplicate the date and only change the new data with the new format.
PD: is awesome that with scripted field you can do doc['time].value and you can not change the type of the new field but Kibana change the value to miliseconds.
Related
I want to get the date in this format -
MM-dd-yy.
For example: 10-12-23
I'm writing this code but don't getting the desired solution -
{<entity_name>:<attribute>/#date;} Check-In Link
What should I write in the date part?
I'm afraid the only way to make it work is to set the user's locale to a locale that uses MM-dd-yy format.
Alternatively, it's possible to create a custom string field, populate that field with a properly formatted date and use the value of it in your template.
I am having trouble formatting a date in Gatsby. I have sourced some data from firestore. One of the fields that I have sourced is called datePublished and it contains a number in the form of a timestamp (e.g., 1576945502000). Indeed, it really is a timestamp, but it got saved to firestore in the number format type.
Now, I would like to format the datePublished field using the formatString function in graphql -- as noted here: https://www.gatsbyjs.org/docs/graphql-reference/#dates
But I can't get the formatting to work. Whether I try to format the string in graphiql or on my site, it does not work. Here is the code that I tried:
query MyQuery {
allNewsFeed {
edges {
node {
published(formatString:"dddd Mo, YYYY")
}
}
}
}
And this is the error message that I get in graphiql:
Unknown argument "formatString on field 'datePublished' of type 'NewsFeed'.
If I dig a little deeper, I notice that the field type in firestore is listed as number and in the graphiql document explorer it is listed as a FloatQueryOperatorInput.
What's more, I did a little experiment where I tried to save the same number as a string, number and timestamp in firestore. Neither the string or number format worked and for whatever reason, the gatsby-firesource plugin will not pull in the field with a timestamp format.
So I am wondering, what do I have to do to get this to work in gatsby?
Any ideas?
Thanks.
I had a similar situation with Gatsby not accepting "formatString" on a date field, for me what solved the issue was to change the format of the field to YYYY-MM-DD so it went from 02 06 2017 to 2017-06-02 and gatsby got the hint that that field represents a date.
It seems gatsby "reads" the data and guesses the type and based on that we get certain functionality.
Since gatsby uses moment.js I'm guessing the YYYY-MM-DD format is picked up by it.
I'm using MDX so it was really easy for me to change the format of my date field since it's just plain text, I'm not sure you have the same luxury with firestore but I hope this at least give you some ideas to try out. Good luck!
I have a view created in a drupal 7 to display the data fields from a table in the database and one of the fields is date_entered which is a timestamp. But the data in the timestamp field shows up as same for each record as " 1969/12/31 - 19:33" instead of what's there in the table.
I have tried changing the timestamp format and applying a patch to fix the issue but nothing seems to fix this.
Do u use the date module? It solves all date and timestamp issues.
Found a work around, i created a hidden field using date module and used the default site format to populate the hidden field and used the array while doing the submit db insert which in turn populates the data base table with the current date of submission and used that date field in the view to display the date instead of the complete timestamp.
My Data are stored in a MySql Database and i use Metabaseto display the data.
In phpMyAdmineverything looks like it should, but in Metabase the Dates are displayed like they should. The two datetimes types do not really matter but the time type looks like a date altough it's a time.
What can i do so that the time is displayed correctly?
Table Structure:
Table Data:
Metabase:
Try to force date format using DATE_FORMAT/TIME_FORMAT in the output fields list:
DATE_FORMAT(started, '%Y-%m-%d %H:%i:%s') as started,
TIME_FORMAT(testDuration, '%H:%i:%s') as testDuration
Instead of hard coding something, there is a wheel setting button that you can change the format for timing...
and then -->:
Hey, I'm trying to build the most intuitive possible Event post type. I'm wondering if there's a core method to both print out and capture the contents of a date field - specifically year/month/day, I don't need hours/minutes. I also need to be able to sort entries by date to print out later - for instance, I need all of the events from January. Something that can save me formatting the fields, and then parsing and saving them manually.
Any ideas are welcomed! Thanks in advance for your time.
There was no rock solid WP core solution to this, but the system I created is composed of:
SQL CONCAT to compare a date field to CURDATE, etc.
PHP strToTime to get the date back from the database
Generally speaking, if you save your date to the DB in UNIX time format it's easy to work with in SQL queries and in your PHP output.